1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
'\" t
.TH TQCanvasText 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQCanvasText \- Text object on a TQCanvas
.SH SYNOPSIS
\fC#include <tqcanvas.h>\fR
.PP
Inherits TQCanvasItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQCanvasText\fR ( TQCanvas * canvas )"
.br
.ti -1c
.BI "\fBTQCanvasText\fR ( const TQString & t, TQCanvas * canvas )"
.br
.ti -1c
.BI "\fBTQCanvasText\fR ( const TQString & t, TQFont f, TQCanvas * canvas )"
.br
.ti -1c
.BI "virtual \fB~TQCanvasText\fR ()"
.br
.ti -1c
.BI "void \fBsetText\fR ( const TQString & t )"
.br
.ti -1c
.BI "void \fBsetFont\fR ( const TQFont & f )"
.br
.ti -1c
.BI "void \fBsetColor\fR ( const TQColor & c )"
.br
.ti -1c
.BI "TQString \fBtext\fR () const"
.br
.ti -1c
.BI "TQFont \fBfont\fR () const"
.br
.ti -1c
.BI "TQColor \fBcolor\fR () const"
.br
.ti -1c
.BI "int \fBtextFlags\fR () const"
.br
.ti -1c
.BI "void \fBsetTextFlags\fR ( int f )"
.br
.ti -1c
.BI "virtual QRect \fBboundingRect\fR () const"
.br
.ti -1c
.BI "virtual int \fBrtti\fR () const"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBdraw\fR ( TQPainter & painter )"
.br
.in -1c
.SH DESCRIPTION
The TQCanvasText class provides a text object on a TQCanvas.
.PP
A canvas text item has text with font, color and alignment attributes. The text and font can be set in the constructor or set or changed later with setText() and setFont(). The color is set with setColor() and the alignment with setTextFlags(). The text item's bounding rectangle is retrieved with boundingRect().
.PP
The text can be drawn on a painter with draw().
.PP
Like any other canvas item text items can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQCanvasText::TQCanvasText ( TQCanvas * canvas )"
Constructs a TQCanvasText with the text "<text>", on \fIcanvas\fR.
.SH "TQCanvasText::TQCanvasText ( const TQString & t, TQCanvas * canvas )"
Constructs a TQCanvasText with the text \fIt\fR, on canvas \fIcanvas\fR.
.SH "TQCanvasText::TQCanvasText ( const TQString & t, TQFont f, TQCanvas * canvas )"
Constructs a TQCanvasText with the text \fIt\fR and font \fIf\fR, on the canvas \fIcanvas\fR.
.SH "TQCanvasText::~TQCanvasText ()\fC [virtual]\fR"
Destroys the canvas text item.
.SH "QRect TQCanvasText::boundingRect () const\fC [virtual]\fR"
Returns the bounding rectangle of the text.
.PP
Reimplemented from TQCanvasItem.
.SH "TQColor TQCanvasText::color () const"
Returns the color of the text.
.PP
See also setColor().
.SH "void TQCanvasText::draw ( TQPainter & painter )\fC [virtual protected]\fR"
Draws the text using the painter \fIpainter\fR.
.PP
Reimplemented from TQCanvasItem.
.SH "TQFont TQCanvasText::font () const"
Returns the font in which the text is drawn.
.PP
See also setFont().
.SH "int TQCanvasText::rtti () const\fC [virtual]\fR"
Returns 3 (TQCanvasItem::Rtti_Text).
.PP
See also TQCanvasItem::rtti().
.PP
Reimplemented from TQCanvasItem.
.SH "void TQCanvasText::setColor ( const TQColor & c )"
Sets the color of the text to the color \fIc\fR.
.PP
See also color() and setFont().
.PP
Example: chart/chartform_canvas.cpp.
.SH "void TQCanvasText::setFont ( const TQFont & f )"
Sets the font in which the text is drawn to font \fIf\fR.
.PP
See also font().
.SH "void TQCanvasText::setText ( const TQString & t )"
Sets the text item's text to \fIt\fR. The text may contain newlines.
.PP
See also text(), setFont(), setColor(), and setTextFlags().
.PP
Example: canvas/canvas.cpp.
.SH "void TQCanvasText::setTextFlags ( int f )"
Sets the alignment flags to \fIf\fR. These are a bitwise OR of the flags available to TQPainter::drawText() -- see the TQt::AlignmentFlags.
.PP
See also setFont() and setColor().
.SH "TQString TQCanvasText::text () const"
Returns the text item's text.
.PP
See also setText().
.SH "int TQCanvasText::textFlags () const"
Returns the currently set alignment flags.
.PP
See also setTextFlags() and TQt::AlignmentFlags.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqcanvastext.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqcanvastext.3qt) and the Qt
version (3.3.8).
|