1
.TH "QwtPainter" 3 "26 Feb 2007" "Version 5.0.1" "Qwt User's Guide" \" -*- nroff -*-
9
.SH "Detailed Description"
11
A collection of QPainter workarounds.
13
1) Clipping to coordinate system limits (Qt3 only)
15
On X11 pixel coordinates are stored in shorts. Qt produces overruns when mapping QCOORDS to shorts.
17
2) Scaling to device metrics
19
QPainter scales fonts, line and fill patterns to the metrics of the paint device. Other values like the geometries of rects, points remain device independend. To enable a device independent widget implementation, \fBQwtPainter\fP adds scaling of these geometries. (Unfortunately QPainter::scale scales both types of paintings, so the objects of the first type would be scaled twice).
21
Definition at line 62 of file qwt_painter.h.
22
.SS "Static Public Member Functions"
26
.RI "static void \fBsetMetricsMap\fP (const QPaintDevice *layout, const QPaintDevice *device)"
29
.RI "static void \fBsetMetricsMap\fP (const \fBQwtMetricsMap\fP &)"
32
.RI "static void \fBresetMetricsMap\fP ()"
35
.RI "static const \fBQwtMetricsMap\fP & \fBmetricsMap\fP ()"
38
.RI "static void \fBsetDeviceClipping\fP (bool)"
41
.RI "static bool \fBdeviceClipping\fP ()"
44
.RI "static void \fBsetClipRect\fP (QPainter *, const QRect &)"
47
.RI "static void \fBdrawText\fP (QPainter *, int x, int y, const QString &)"
50
.RI "static void \fBdrawText\fP (QPainter *, const QPoint &, const QString &)"
53
.RI "static void \fBdrawText\fP (QPainter *, int x, int y, int w, int h, int flags, const QString &)"
56
.RI "static void \fBdrawText\fP (QPainter *, const QRect &, int flags, const QString &)"
59
.RI "static void \fBdrawSimpleRichText\fP (QPainter *, const QRect &, int flags, QTextDocument &)"
62
.RI "static void \fBdrawRect\fP (QPainter *, int x, int y, int w, int h)"
65
.RI "static void \fBdrawRect\fP (QPainter *, const QRect &rect)"
68
.RI "static void \fBfillRect\fP (QPainter *, const QRect &, const QBrush &)"
71
.RI "static void \fBdrawEllipse\fP (QPainter *, const QRect &)"
74
.RI "static void \fBdrawPie\fP (QPainter *, const QRect &r, int a, int alen)"
77
.RI "static void \fBdrawLine\fP (QPainter *, int x1, int y1, int x2, int y2)"
80
.RI "static void \fBdrawLine\fP (QPainter *, const QPoint &p1, const QPoint &p2)"
83
.RI "static void \fBdrawPolygon\fP (QPainter *, const QwtPolygon &pa)"
86
.RI "static void \fBdrawPolyline\fP (QPainter *, const QwtPolygon &pa)"
89
.RI "static void \fBdrawPoint\fP (QPainter *, int x, int y)"
92
.RI "static void \fBdrawRoundFrame\fP (QPainter *, const QRect &, int width, const QPalette &, bool sunken)"
95
.RI "static void \fBdrawFocusRect\fP (QPainter *, QWidget *)"
98
.RI "static void \fBdrawFocusRect\fP (QPainter *, QWidget *, const QRect &)"
101
.RI "static QwtPolygon \fBclip\fP (const QwtPolygon &)"
104
.RI "static void \fBdrawColorBar\fP (QPainter *painter, const \fBQwtColorMap\fP &, const \fBQwtDoubleInterval\fP &, const \fBQwtScaleMap\fP &, Qt::Orientation, const QRect &)"
107
.SH "Member Function Documentation"
109
.SS "QwtPolygon QwtPainter::clip (const QwtPolygon &)\fC [static]\fP"
113
Definition at line 94 of file qwt_painter.cpp.
115
References QwtRect::clip().
117
Referenced by drawPolygon(), and drawPolyline().
118
.SS "bool QwtPainter::deviceClipping ()\fC [static]\fP"
120
Returns whether device clipping is enabled. On X11 the default is enabled, otherwise it is disabled.
124
\fBQwtPainter::setDeviceClipping()\fP
129
Definition at line 72 of file qwt_painter.cpp.
130
.SS "void QwtPainter::drawEllipse (QPainter * painter, const QRect & rect)\fC [static]\fP"
132
Wrapper for QPainter::drawEllipse()
134
Definition at line 294 of file qwt_painter.cpp.
136
References QwtMetricsMap::layoutToDevice().
138
Referenced by QwtSymbol::draw(), and QwtPicker::drawRubberBand().
139
.SS "void QwtPainter::drawLine (QPainter *, const QPoint & p1, const QPoint & p2)\fC [inline, static]\fP"
141
Wrapper for QPainter::drawLine().
143
Definition at line 143 of file qwt_painter.h.
145
References drawLine().
146
.SS "void QwtPainter::drawLine (QPainter * painter, int x1, int y1, int x2, int y2)\fC [static]\fP"
148
Wrapper for QPainter::drawLine()
150
Definition at line 437 of file qwt_painter.cpp.
152
References drawPolyline(), and QwtMetricsMap::isIdentity().
154
Referenced by QwtSymbol::draw(), QwtPlotMarker::draw(), QwtScaleDraw::drawBackbone(), QwtPlotSpectrogram::drawContourLines(), QwtLegendItem::drawIdentifier(), drawLine(), QwtPicker::drawRubberBand(), QwtPlotCurve::drawSticks(), and QwtRoundScaleDraw::drawTick().
155
.SS "void QwtPainter::drawPie (QPainter * painter, const QRect & rect, int a, int alen)\fC [static]\fP"
157
Wrapper for QPainter::drawPie()
159
Definition at line 279 of file qwt_painter.cpp.
161
References QwtMetricsMap::layoutToDevice().
162
.SS "void QwtPainter::drawPoint (QPainter * painter, int x, int y)\fC [static]\fP"
164
Wrapper for QPainter::drawPoint()
166
Definition at line 518 of file qwt_painter.cpp.
168
References QwtMetricsMap::layoutToDevice().
170
Referenced by QwtPlotCurve::drawDots().
171
.SS "void QwtPainter::drawPolygon (QPainter * painter, const QwtPolygon & pa)\fC [static]\fP"
173
Wrapper for QPainter::drawPolygon()
175
Definition at line 487 of file qwt_painter.cpp.
177
References clip(), and QwtMetricsMap::layoutToDevice().
179
Referenced by QwtSymbol::draw(), and QwtPlotCurve::fillCurve().
180
.SS "void QwtPainter::drawPolyline (QPainter * painter, const QwtPolygon & pa)\fC [static]\fP"
182
Wrapper for QPainter::drawPolyline()
184
Definition at line 504 of file qwt_painter.cpp.
186
References clip(), and QwtMetricsMap::layoutToDevice().
188
Referenced by drawLine(), and drawRect().
189
.SS "void QwtPainter::drawRect (QPainter * painter, const QRect & rect)\fC [static]\fP"
191
Wrapper for QPainter::drawRect()
193
Definition at line 184 of file qwt_painter.cpp.
195
References drawPolyline(), fillRect(), and QwtMetricsMap::layoutToDevice().
196
.SS "void QwtPainter::drawRect (QPainter * painter, int x, int y, int w, int h)\fC [static]\fP"
198
Wrapper for QPainter::drawRect()
200
Definition at line 176 of file qwt_painter.cpp.
202
Referenced by QwtText::draw(), QwtSymbol::draw(), drawColorBar(), and QwtPicker::drawRubberBand().
203
.SS "void QwtPainter::drawRoundFrame (QPainter *, const QRect &, int width, const QPalette &, bool sunken)\fC [static]\fP"
207
Definition at line 592 of file qwt_painter.cpp.
209
Referenced by QwtDial::drawFrame().
210
.SS "void QwtPainter::drawSimpleRichText (QPainter * painter, const QRect & rect, int flags, QTextDocument & text)\fC [static]\fP"
212
Wrapper for QSimpleRichText::draw()
214
Definition at line 404 of file qwt_painter.cpp.
216
References QwtMetricsMap::layoutToDevice().
218
Referenced by QwtRichTextEngine::draw().
219
.SS "void QwtPainter::drawText (QPainter * painter, const QRect & rect, int flags, const QString & text)\fC [static]\fP"
221
Wrapper for QPainter::drawText()
223
Definition at line 357 of file qwt_painter.cpp.
225
References QwtMetricsMap::layoutToDevice().
226
.SS "void QwtPainter::drawText (QPainter * painter, int x, int y, int w, int h, int flags, const QString & text)\fC [static]\fP"
228
Wrapper for QPainter::drawText()
230
Definition at line 348 of file qwt_painter.cpp.
232
References drawText().
233
.SS "void QwtPainter::drawText (QPainter * painter, const QPoint & pos, const QString & text)\fC [static]\fP"
235
Wrapper for QPainter::drawText()
237
Definition at line 332 of file qwt_painter.cpp.
239
References QwtMetricsMap::layoutToDevice().
240
.SS "void QwtPainter::drawText (QPainter * painter, int x, int y, const QString & text)\fC [static]\fP"
242
Wrapper for QPainter::drawText()
244
Definition at line 323 of file qwt_painter.cpp.
246
Referenced by QwtPlainTextEngine::draw(), and drawText().
247
.SS "void QwtPainter::fillRect (QPainter * painter, const QRect & rect, const QBrush & brush)\fC [static]\fP"
249
Wrapper for QPainter::fillRect()
251
Definition at line 241 of file qwt_painter.cpp.
253
References QwtMetricsMap::layoutToDevice().
255
Referenced by drawRect().
256
.SS "const \fBQwtMetricsMap\fP & QwtPainter::metricsMap ()\fC [static]\fP"
265
Definition at line 160 of file qwt_painter.cpp.
267
Referenced by QwtText::draw(), QwtSymbol::draw(), QwtLegendItem::drawIdentifier(), QwtLegendItem::drawItem(), QwtPlotCurve::drawSymbols(), QwtScaleDraw::drawTick(), QwtText::heightForWidth(), QwtPlot::print(), and QwtPlot::printScale().
268
.SS "void QwtPainter::resetMetricsMap ()\fC [static]\fP"
270
Reset the metrics map to the ratio 1:1
274
\fBQwtPainter::setMetricsMap\fP, \fBQwtPainter::resetMetricsMap\fP
279
Definition at line 152 of file qwt_painter.cpp.
281
Referenced by QwtScaleDraw::drawTick().
282
.SS "void QwtPainter::setClipRect (QPainter * painter, const QRect & rect)\fC [static]\fP"
284
Wrapper for QPainter::setClipRect()
286
Definition at line 168 of file qwt_painter.cpp.
288
References QwtMetricsMap::layoutToDevice().
290
Referenced by drawColorBar(), and QwtPlot::printLegend().
291
.SS "void QwtPainter::setDeviceClipping (bool enable)\fC [static]\fP"
293
En/Disable device clipping.
295
On X11 the default for device clipping is enabled, otherwise it is disabled.
299
\fBQwtPainter::deviceClipping()\fP
304
Definition at line 61 of file qwt_painter.cpp.
305
.SS "void QwtPainter::setMetricsMap (const \fBQwtMetricsMap\fP & map)\fC [static]\fP"
307
Change the metrics map
311
\fBQwtPainter::resetMetricsMap\fP, \fBQwtPainter::metricsMap\fP
316
Definition at line 143 of file qwt_painter.cpp.
317
.SS "void QwtPainter::setMetricsMap (const QPaintDevice * layout, const QPaintDevice * device)\fC [static]\fP"
319
Scale all \fBQwtPainter\fP drawing operations using the ratio QwtPaintMetrics(from).logicalDpiX() / QwtPaintMetrics(to).logicalDpiX() and QwtPaintMetrics(from).logicalDpiY() / QwtPaintMetrics(to).logicalDpiY()
323
QwtPainter::resetScaleMetrics(), QwtPainter::scaleMetricsX, QwtPainter::scaleMetricsY()
328
Definition at line 133 of file qwt_painter.cpp.
330
References QwtMetricsMap::setMetrics().
332
Referenced by QwtPlot::print().
336
Generated automatically by Doxygen for Qwt User's Guide from the source code.