QwtPlotTextLabel.3
3.89 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.TH "QwtPlotTextLabel" 3 "Sat Jan 26 2013" "Version 6.1-rc3" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotTextLabel \-
.PP
A plot item, which displays a text label\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_textlabel\&.h>\fP
.PP
Inherits \fBQwtPlotItem\fP\&.
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBQwtPlotTextLabel\fP ()"
.br
.RI "\fIConstructor\&. \fP"
.ti -1c
.RI "virtual \fB~QwtPlotTextLabel\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "virtual int \fBrtti\fP () const "
.br
.ti -1c
.RI "void \fBsetText\fP (const \fBQwtText\fP &)"
.br
.ti -1c
.RI "\fBQwtText\fP \fBtext\fP () const "
.br
.ti -1c
.RI "void \fBsetMargin\fP (int \fBmargin\fP)"
.br
.ti -1c
.RI "int \fBmargin\fP () const "
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *, const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &, const QRectF &) const "
.br
.ti -1c
.RI "void \fBinvalidateCache\fP ()"
.br
.RI "\fIInvalidate all internal cache\&. \fP"
.in -1c
.SS "Additional Inherited Members"
.SH "Detailed Description"
.PP
A plot item, which displays a text label\&.
\fBQwtPlotTextLabel\fP displays a text label aligned to the plot canvas\&.
.PP
In opposite to \fBQwtPlotMarker\fP the position of the label is unrelated to plot coordinates\&.
.PP
As drawing a text is an expensive operation the label is cached in a pixmap to speed up replots\&.
.PP
\fBExample\fP
.RS 4
The following code shows how to add a title\&.
.RE
.PP
.PP
.nf
QwtText title( "Plot Title" );
title.setRenderFlags( Qt::AlignHCenter | Qt::AlignTop );
QFont font;
font.setBold( true );
title.setFont( font );
QwtPlotTextLabel *titleItem = new QwtPlotTextLabel();
titleItem->setText( title );
titleItem->attach( this );
.fi
.PP
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotMarker\fP
.RE
.PP
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtPlotTextLabel::QwtPlotTextLabel ()"
.PP
Constructor\&. Initializes an text label with an empty text
.PP
Sets the following item attributes:
.PP
.IP "\(bu" 2
\fBQwtPlotItem::AutoScale\fP: true
.IP "\(bu" 2
\fBQwtPlotItem::Legend\fP: false
.PP
.PP
The z value is initialized by 150
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotItem::setItemAttribute()\fP, \fBQwtPlotItem::setZ()\fP
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "void QwtPlotTextLabel::draw (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const\fC [protected]\fP, \fC [virtual]\fP"
Draw the text label
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.br
\fIxMap\fP x Scale Map
.br
\fIyMap\fP y Scale Map
.br
\fIcanvasRect\fP Contents rectangle of the canvas in painter coordinates
.RE
.PP
.PP
Implements \fBQwtPlotItem\fP\&.
.SS "int QwtPlotTextLabel::margin () const"
\fBReturns:\fP
.RS 4
Margin added to the contentsMargins() of the canvas
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetMargin()\fP
.RE
.PP
.SS "int QwtPlotTextLabel::rtti () const\fC [virtual]\fP"
\fBReturns:\fP
.RS 4
\fBQwtPlotItem::Rtti_PlotTextLabel\fP
.RE
.PP
.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "void QwtPlotTextLabel::setMargin (intmargin)"
Set the margin
.PP
The margin is the distance between the contentsRect() of the plot canvas and the rectangle where the label can be displayed
.PP
\fBParameters:\fP
.RS 4
\fImargin\fP Margin
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmargin()\fP
.RE
.PP
.SS "void QwtPlotTextLabel::setText (const \fBQwtText\fP &text)"
Set the text
.PP
The label will be aligned to the plot canvas according to the alignment flags of text\&.
.PP
\fBParameters:\fP
.RS 4
\fItext\fP Text to be displayed
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtext()\fP, \fBQwtText::renderFlags()\fP
.RE
.PP
.SS "\fBQwtText\fP QwtPlotTextLabel::text () const"
\fBReturns:\fP
.RS 4
Text to be displayed
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetText()\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.