summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqcanvastext.3qt
blob: c80e246a6b30019f719bcf68a7dda19ec2eef62e (plain)
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 QCanvasText 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
QCanvasText \- Text object on a QCanvas
.SH SYNOPSIS
\fC#include <ntqcanvas.h>\fR
.PP
Inherits QCanvasItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQCanvasText\fR ( QCanvas * canvas )"
.br
.ti -1c
.BI "\fBQCanvasText\fR ( const TQString & t, QCanvas * canvas )"
.br
.ti -1c
.BI "\fBQCanvasText\fR ( const TQString & t, QFont f, QCanvas * canvas )"
.br
.ti -1c
.BI "virtual \fB~QCanvasText\fR ()"
.br
.ti -1c
.BI "void \fBsetText\fR ( const TQString & t )"
.br
.ti -1c
.BI "void \fBsetFont\fR ( const QFont & f )"
.br
.ti -1c
.BI "void \fBsetColor\fR ( const TQColor & c )"
.br
.ti -1c
.BI "TQString \fBtext\fR () const"
.br
.ti -1c
.BI "QFont \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 ( QPainter & painter )"
.br
.in -1c
.SH DESCRIPTION
The QCanvasText class provides a text object on a QCanvas.
.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 QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCanvasText::QCanvasText ( QCanvas * canvas )"
Constructs a QCanvasText with the text "<text>", on \fIcanvas\fR.
.SH "QCanvasText::QCanvasText ( const TQString & t, QCanvas * canvas )"
Constructs a QCanvasText with the text \fIt\fR, on canvas \fIcanvas\fR.
.SH "QCanvasText::QCanvasText ( const TQString & t, QFont f, QCanvas * canvas )"
Constructs a QCanvasText with the text \fIt\fR and font \fIf\fR, on the canvas \fIcanvas\fR.
.SH "QCanvasText::~QCanvasText ()\fC [virtual]\fR"
Destroys the canvas text item.
.SH "QRect QCanvasText::boundingRect () const\fC [virtual]\fR"
Returns the bounding rectangle of the text.
.PP
Reimplemented from QCanvasItem.
.SH "TQColor QCanvasText::color () const"
Returns the color of the text.
.PP
See also setColor().
.SH "void QCanvasText::draw ( QPainter & painter )\fC [virtual protected]\fR"
Draws the text using the painter \fIpainter\fR.
.PP
Reimplemented from QCanvasItem.
.SH "QFont QCanvasText::font () const"
Returns the font in which the text is drawn.
.PP
See also setFont().
.SH "int QCanvasText::rtti () const\fC [virtual]\fR"
Returns 3 (QCanvasItem::Rtti_Text).
.PP
See also QCanvasItem::rtti().
.PP
Reimplemented from QCanvasItem.
.SH "void QCanvasText::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 QCanvasText::setFont ( const QFont & f )"
Sets the font in which the text is drawn to font \fIf\fR.
.PP
See also font().
.SH "void QCanvasText::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 QCanvasText::setTextFlags ( int f )"
Sets the alignment flags to \fIf\fR. These are a bitwise OR of the flags available to QPainter::drawText() -- see the Qt::AlignmentFlags.
.PP
See also setFont() and setColor().
.SH "TQString QCanvasText::text () const"
Returns the text item's text.
.PP
See also setText().
.SH "int QCanvasText::textFlags () const"
Returns the currently set alignment flags.
.PP
See also setTextFlags() and Qt::AlignmentFlags.

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcanvastext.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).