Qt 4.8
qpainter.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QPAINTER_H
43 #define QPAINTER_H
44 
45 #include <QtCore/qnamespace.h>
46 #include <QtCore/qrect.h>
47 #include <QtCore/qpoint.h>
48 #include <QtCore/qscopedpointer.h>
49 #include <QtGui/qpixmap.h>
50 #include <QtGui/qimage.h>
51 #include <QtGui/qtextoption.h>
52 #include <QtGui/qdrawutil.h>
53 
54 #ifndef QT_INCLUDE_COMPAT
55 #include <QtGui/qpolygon.h>
56 #include <QtGui/qpen.h>
57 #include <QtGui/qbrush.h>
58 #include <QtGui/qmatrix.h>
59 #include <QtGui/qtransform.h>
60 #include <QtGui/qfontinfo.h>
61 #include <QtGui/qfontmetrics.h>
62 #endif
63 
65 
67 
68 QT_MODULE(Gui)
69 
70 class QBrush;
71 class QFontInfo;
72 class QFontMetrics;
73 class QPaintDevice;
74 class QPainterPath;
75 class QPainterPrivate;
76 class QPen;
77 class QPolygon;
78 class QTextItem;
79 class QMatrix;
80 class QTransform;
81 class QStaticText;
82 class QGlyphRun;
83 
84 class QPainterPrivateDeleter;
85 
87 {
89  Q_GADGET
90  Q_FLAGS(RenderHint RenderHints)
91 
92 public:
93  enum RenderHint {
94  Antialiasing = 0x01,
95  TextAntialiasing = 0x02,
96  SmoothPixmapTransform = 0x04,
97  HighQualityAntialiasing = 0x08,
98  NonCosmeticDefaultPen = 0x10
99  };
100 
101  Q_DECLARE_FLAGS(RenderHints, RenderHint)
102 
104  public:
115  static PixmapFragment Q_GUI_EXPORT create(const QPointF &pos, const QRectF &sourceRect,
116  qreal scaleX = 1, qreal scaleY = 1,
117  qreal rotation = 0, qreal opacity = 1);
118  };
119 
121  OpaqueHint = 0x01
122  };
123 
124  Q_DECLARE_FLAGS(PixmapFragmentHints, PixmapFragmentHint)
125 
126  QPainter();
127  explicit QPainter(QPaintDevice *);
128  ~QPainter();
129 
130  QPaintDevice *device() const;
131 
132  bool begin(QPaintDevice *);
133  bool end();
134  bool isActive() const;
135 
136  void initFrom(const QWidget *widget);
137 
151 
152  //svg 1.2 blend modes
165 
166  // ROPs
175  RasterOp_SourceAndNotDestination
176  };
177  void setCompositionMode(CompositionMode mode);
178  CompositionMode compositionMode() const;
179 
180  const QFont &font() const;
181  void setFont(const QFont &f);
182 
183  QFontMetrics fontMetrics() const;
184  QFontInfo fontInfo() const;
185 
186  void setPen(const QColor &color);
187  void setPen(const QPen &pen);
188  void setPen(Qt::PenStyle style);
189  const QPen &pen() const;
190 
191  void setBrush(const QBrush &brush);
192  void setBrush(Qt::BrushStyle style);
193  const QBrush &brush() const;
194 
195  // attributes/modes
196  void setBackgroundMode(Qt::BGMode mode);
197  Qt::BGMode backgroundMode() const;
198 
199  QPoint brushOrigin() const;
200  inline void setBrushOrigin(int x, int y);
201  inline void setBrushOrigin(const QPoint &);
202  void setBrushOrigin(const QPointF &);
203 
204  void setBackground(const QBrush &bg);
205  const QBrush &background() const;
206 
207  qreal opacity() const;
208  void setOpacity(qreal opacity);
209 
210  // Clip functions
211  QRegion clipRegion() const;
212  QPainterPath clipPath() const;
213 
214  void setClipRect(const QRectF &, Qt::ClipOperation op = Qt::ReplaceClip);
215  void setClipRect(const QRect &, Qt::ClipOperation op = Qt::ReplaceClip);
216  inline void setClipRect(int x, int y, int w, int h, Qt::ClipOperation op = Qt::ReplaceClip);
217 
218  void setClipRegion(const QRegion &, Qt::ClipOperation op = Qt::ReplaceClip);
219 
220  void setClipPath(const QPainterPath &path, Qt::ClipOperation op = Qt::ReplaceClip);
221 
222  void setClipping(bool enable);
223  bool hasClipping() const;
224 
225  QRectF clipBoundingRect() const;
226 
227  void save();
228  void restore();
229 
230  // XForm functions
231  void setMatrix(const QMatrix &matrix, bool combine = false);
232  const QMatrix &matrix() const;
233  const QMatrix &deviceMatrix() const;
234  void resetMatrix();
235 
236  void setTransform(const QTransform &transform, bool combine = false);
237  const QTransform &transform() const;
238  const QTransform &deviceTransform() const;
239  void resetTransform();
240 
241  void setWorldMatrix(const QMatrix &matrix, bool combine = false);
242  const QMatrix &worldMatrix() const;
243 
244  void setWorldTransform(const QTransform &matrix, bool combine = false);
245  const QTransform &worldTransform() const;
246 
247  QMatrix combinedMatrix() const;
248  QTransform combinedTransform() const;
249 
250  void setMatrixEnabled(bool enabled);
251  bool matrixEnabled() const;
252 
253  void setWorldMatrixEnabled(bool enabled);
254  bool worldMatrixEnabled() const;
255 
256  void scale(qreal sx, qreal sy);
257  void shear(qreal sh, qreal sv);
258  void rotate(qreal a);
259 
260  void translate(const QPointF &offset);
261  inline void translate(const QPoint &offset);
262  inline void translate(qreal dx, qreal dy);
263 
264  QRect window() const;
265  void setWindow(const QRect &window);
266  inline void setWindow(int x, int y, int w, int h);
267 
268  QRect viewport() const;
269  void setViewport(const QRect &viewport);
270  inline void setViewport(int x, int y, int w, int h);
271 
272  void setViewTransformEnabled(bool enable);
273  bool viewTransformEnabled() const;
274 
275  // drawing functions
276  void strokePath(const QPainterPath &path, const QPen &pen);
277  void fillPath(const QPainterPath &path, const QBrush &brush);
278  void drawPath(const QPainterPath &path);
279 
280  inline void drawPoint(const QPointF &pt);
281  inline void drawPoint(const QPoint &p);
282  inline void drawPoint(int x, int y);
283 
284  void drawPoints(const QPointF *points, int pointCount);
285  inline void drawPoints(const QPolygonF &points);
286  void drawPoints(const QPoint *points, int pointCount);
287  inline void drawPoints(const QPolygon &points);
288 
289  inline void drawLine(const QLineF &line);
290  inline void drawLine(const QLine &line);
291  inline void drawLine(int x1, int y1, int x2, int y2);
292  inline void drawLine(const QPoint &p1, const QPoint &p2);
293  inline void drawLine(const QPointF &p1, const QPointF &p2);
294 
295  void drawLines(const QLineF *lines, int lineCount);
296  inline void drawLines(const QVector<QLineF> &lines);
297  void drawLines(const QPointF *pointPairs, int lineCount);
298  inline void drawLines(const QVector<QPointF> &pointPairs);
299  void drawLines(const QLine *lines, int lineCount);
300  inline void drawLines(const QVector<QLine> &lines);
301  void drawLines(const QPoint *pointPairs, int lineCount);
302  inline void drawLines(const QVector<QPoint> &pointPairs);
303 
304  inline void drawRect(const QRectF &rect);
305  inline void drawRect(int x1, int y1, int w, int h);
306  inline void drawRect(const QRect &rect);
307 
308  void drawRects(const QRectF *rects, int rectCount);
309  inline void drawRects(const QVector<QRectF> &rectangles);
310  void drawRects(const QRect *rects, int rectCount);
311  inline void drawRects(const QVector<QRect> &rectangles);
312 
313  void drawEllipse(const QRectF &r);
314  void drawEllipse(const QRect &r);
315  inline void drawEllipse(int x, int y, int w, int h);
316 
317  inline void drawEllipse(const QPointF &center, qreal rx, qreal ry);
318  inline void drawEllipse(const QPoint &center, int rx, int ry);
319 
320  void drawPolyline(const QPointF *points, int pointCount);
321  inline void drawPolyline(const QPolygonF &polyline);
322  void drawPolyline(const QPoint *points, int pointCount);
323  inline void drawPolyline(const QPolygon &polygon);
324 
325  void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
326  inline void drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
327  void drawPolygon(const QPoint *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
328  inline void drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
329 
330  void drawConvexPolygon(const QPointF *points, int pointCount);
331  inline void drawConvexPolygon(const QPolygonF &polygon);
332  void drawConvexPolygon(const QPoint *points, int pointCount);
333  inline void drawConvexPolygon(const QPolygon &polygon);
334 
335  void drawArc(const QRectF &rect, int a, int alen);
336  inline void drawArc(const QRect &, int a, int alen);
337  inline void drawArc(int x, int y, int w, int h, int a, int alen);
338 
339  void drawPie(const QRectF &rect, int a, int alen);
340  inline void drawPie(int x, int y, int w, int h, int a, int alen);
341  inline void drawPie(const QRect &, int a, int alen);
342 
343  void drawChord(const QRectF &rect, int a, int alen);
344  inline void drawChord(int x, int y, int w, int h, int a, int alen);
345  inline void drawChord(const QRect &, int a, int alen);
346 
347  void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
349  inline void drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
351  inline void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
353 
354  void drawRoundRect(const QRectF &r, int xround = 25, int yround = 25);
355  inline void drawRoundRect(int x, int y, int w, int h, int = 25, int = 25);
356  inline void drawRoundRect(const QRect &r, int xround = 25, int yround = 25);
357 
358  void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset = QPointF());
359  inline void drawTiledPixmap(int x, int y, int w, int h, const QPixmap &, int sx=0, int sy=0);
360  inline void drawTiledPixmap(const QRect &, const QPixmap &, const QPoint & = QPoint());
361 #ifndef QT_NO_PICTURE
362  void drawPicture(const QPointF &p, const QPicture &picture);
363  inline void drawPicture(int x, int y, const QPicture &picture);
364  inline void drawPicture(const QPoint &p, const QPicture &picture);
365 #endif
366 
367  void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect);
368  inline void drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect);
369  inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
370  int sx, int sy, int sw, int sh);
371  inline void drawPixmap(int x, int y, const QPixmap &pm,
372  int sx, int sy, int sw, int sh);
373  inline void drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr);
374  inline void drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr);
375  void drawPixmap(const QPointF &p, const QPixmap &pm);
376  inline void drawPixmap(const QPoint &p, const QPixmap &pm);
377  inline void drawPixmap(int x, int y, const QPixmap &pm);
378  inline void drawPixmap(const QRect &r, const QPixmap &pm);
379  inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
380 
381  void drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount,
382  const QPixmap &pixmap, PixmapFragmentHints hints = 0);
383  void drawPixmapFragments(const QRectF *targetRects, const QRectF *sourceRects, int fragmentCount,
384  const QPixmap &pixmap, PixmapFragmentHints hints = 0);
385 
386  void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
387  Qt::ImageConversionFlags flags = Qt::AutoColor);
388  inline void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
389  Qt::ImageConversionFlags flags = Qt::AutoColor);
390  inline void drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
391  Qt::ImageConversionFlags flags = Qt::AutoColor);
392  inline void drawImage(const QPoint &p, const QImage &image, const QRect &sr,
393  Qt::ImageConversionFlags flags = Qt::AutoColor);
394  inline void drawImage(const QRectF &r, const QImage &image);
395  inline void drawImage(const QRect &r, const QImage &image);
396  void drawImage(const QPointF &p, const QImage &image);
397  inline void drawImage(const QPoint &p, const QImage &image);
398  inline void drawImage(int x, int y, const QImage &image, int sx = 0, int sy = 0,
399  int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor);
400 
401  void setLayoutDirection(Qt::LayoutDirection direction);
402  Qt::LayoutDirection layoutDirection() const;
403 
404 #if !defined(QT_NO_RAWFONT)
405  void drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun);
406 #endif
407 
408  void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText);
409  inline void drawStaticText(const QPoint &topLeftPosition, const QStaticText &staticText);
410  inline void drawStaticText(int left, int top, const QStaticText &staticText);
411 
412  void drawText(const QPointF &p, const QString &s);
413  inline void drawText(const QPoint &p, const QString &s);
414  inline void drawText(int x, int y, const QString &s);
415 
416  void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
417 
418  void drawText(const QRectF &r, int flags, const QString &text, QRectF *br=0);
419  void drawText(const QRect &r, int flags, const QString &text, QRect *br=0);
420  inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br=0);
421 
422  void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
423 
424  QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
425  QRect boundingRect(const QRect &rect, int flags, const QString &text);
426  inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
427 
428  QRectF boundingRect(const QRectF &rect, const QString &text, const QTextOption &o = QTextOption());
429 
430  void drawTextItem(const QPointF &p, const QTextItem &ti);
431  inline void drawTextItem(int x, int y, const QTextItem &ti);
432  inline void drawTextItem(const QPoint &p, const QTextItem &ti);
433 
434  void fillRect(const QRectF &, const QBrush &);
435  inline void fillRect(int x, int y, int w, int h, const QBrush &);
436  void fillRect(const QRect &, const QBrush &);
437 
438  void fillRect(const QRectF &, const QColor &color);
439  inline void fillRect(int x, int y, int w, int h, const QColor &color);
440  void fillRect(const QRect &, const QColor &color);
441 
442  inline void fillRect(int x, int y, int w, int h, Qt::GlobalColor c);
443  inline void fillRect(const QRect &r, Qt::GlobalColor c);
444  inline void fillRect(const QRectF &r, Qt::GlobalColor c);
445 
446  inline void fillRect(int x, int y, int w, int h, Qt::BrushStyle style);
447  inline void fillRect(const QRect &r, Qt::BrushStyle style);
448  inline void fillRect(const QRectF &r, Qt::BrushStyle style);
449 
450  void eraseRect(const QRectF &);
451  inline void eraseRect(int x, int y, int w, int h);
452  inline void eraseRect(const QRect &);
453 
454  void setRenderHint(RenderHint hint, bool on = true);
455  void setRenderHints(RenderHints hints, bool on = true);
456  RenderHints renderHints() const;
457  inline bool testRenderHint(RenderHint hint) const { return renderHints() & hint; }
458 
459  QPaintEngine *paintEngine() const;
460 
461  static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement,
462  const QPoint& offset = QPoint());
463  static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = 0);
464  static void restoreRedirected(const QPaintDevice *device);
465 
466  void beginNativePainting();
467  void endNativePainting();
468 
469 #ifdef QT3_SUPPORT
470 
471  inline QT3_SUPPORT void setBackgroundColor(const QColor &color) { setBackground(color); }
472  inline QT3_SUPPORT const QColor &backgroundColor() const { return background().color(); }
473 
474  inline QT3_SUPPORT void drawText(int x, int y, const QString &s, int pos, int len)
475  { drawText(x, y, s.mid(pos, len)); }
476  inline QT3_SUPPORT void drawText(const QPoint &p, const QString &s, int pos, int len)
477  { drawText(p, s.mid(pos, len)); }
478  inline QT3_SUPPORT void drawText(int x, int y, const QString &s, int len)
479  { drawText(x, y, s.left(len)); }
480  inline QT3_SUPPORT void drawText(const QPoint &p, const QString &s, int len)
481  { drawText(p, s.left(len)); }
482  inline QT3_SUPPORT void drawText(const QRect &r, int flags, const QString &str, int len, QRect *br=0)
483  { drawText(r, flags, str.left(len), br); }
484  inline QT3_SUPPORT void drawText(int x, int y, int w, int h, int flags, const QString &text, int len, QRect *br=0)
485  { drawText(QRect(x, y, w, h), flags, text.left(len), br); }
486  inline QT3_SUPPORT QRect boundingRect(const QRect &rect, int flags, const QString &text, int len)
487  { return boundingRect(rect, flags, text.left(len)); }
488  inline QT3_SUPPORT QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text, int len)
489  { return boundingRect(QRect(x, y, w, h), flags, text.left(len)); }
490 
491  inline QT3_SUPPORT bool begin(QPaintDevice *pdev, const QWidget *init)
492  { bool ret = begin(pdev); initFrom(init); return ret; }
493  QT3_SUPPORT void drawPoints(const QPolygon &pa, int index, int npoints = -1)
494  { drawPoints(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
495 
496  QT3_SUPPORT void drawCubicBezier(const QPolygon &pa, int index = 0);
497 
498  QT3_SUPPORT void drawLineSegments(const QPolygon &points, int index = 0, int nlines = -1);
499 
500  inline QT3_SUPPORT void drawPolyline(const QPolygon &pa, int index, int npoints = -1)
501  { drawPolyline(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
502 
503  inline QT3_SUPPORT void drawPolygon(const QPolygon &pa, bool winding, int index = 0, int npoints = -1)
504  { drawPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints,
505  winding ? Qt::WindingFill : Qt::OddEvenFill); }
506 
507  inline QT3_SUPPORT void drawPolygon(const QPolygonF &polygon, bool winding, int index = 0,
508  int npoints = -1)
509  { drawPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints,
510  winding ? Qt::WindingFill : Qt::OddEvenFill); }
511 
512  inline QT3_SUPPORT void drawConvexPolygon(const QPolygonF &polygon, int index, int npoints = -1)
513  { drawConvexPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints); }
514  inline QT3_SUPPORT void drawConvexPolygon(const QPolygon &pa, int index, int npoints = -1)
515  { drawConvexPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
516 
517  static inline QT3_SUPPORT void redirect(QPaintDevice *pdev, QPaintDevice *replacement)
518  { setRedirected(pdev, replacement); }
519  static inline QT3_SUPPORT QPaintDevice *redirect(QPaintDevice *pdev)
520  { return const_cast<QPaintDevice*>(redirected(pdev)); }
521 
522  inline QT3_SUPPORT void setWorldXForm(bool enabled) { setMatrixEnabled(enabled); }
523  inline QT3_SUPPORT bool hasWorldXForm() const { return matrixEnabled(); }
524  inline QT3_SUPPORT void resetXForm() { resetTransform(); }
525 
526  inline QT3_SUPPORT void setViewXForm(bool enabled) { setViewTransformEnabled(enabled); }
527  inline QT3_SUPPORT bool hasViewXForm() const { return viewTransformEnabled(); }
528 
529  QT3_SUPPORT void map(int x, int y, int *rx, int *ry) const;
530  QT3_SUPPORT QPoint xForm(const QPoint &) const; // map virtual -> deviceb
531  QT3_SUPPORT QRect xForm(const QRect &) const;
532  QT3_SUPPORT QPolygon xForm(const QPolygon &) const;
533  QT3_SUPPORT QPolygon xForm(const QPolygon &, int index, int npoints) const;
534  QT3_SUPPORT QPoint xFormDev(const QPoint &) const; // map device -> virtual
535  QT3_SUPPORT QRect xFormDev(const QRect &) const;
536  QT3_SUPPORT QPolygon xFormDev(const QPolygon &) const;
537  QT3_SUPPORT QPolygon xFormDev(const QPolygon &, int index, int npoints) const;
538  QT3_SUPPORT qreal translationX() const;
539  QT3_SUPPORT qreal translationY() const;
540 #endif
541 
542 private:
544  friend class Q3Painter;
545 
547 
554  friend class QWSManager;
561  friend class QWin32PaintEngine;
562  friend class QWin32PaintEnginePrivate;
566 };
567 
569 
570 //
571 // functions
572 //
573 inline void QPainter::drawLine(const QLineF &l)
574 {
575  drawLines(&l, 1);
576 }
577 
578 inline void QPainter::drawLine(const QLine &line)
579 {
580  drawLines(&line, 1);
581 }
582 
583 inline void QPainter::drawLine(int x1, int y1, int x2, int y2)
584 {
585  QLine l(x1, y1, x2, y2);
586  drawLines(&l, 1);
587 }
588 
589 inline void QPainter::drawLine(const QPoint &p1, const QPoint &p2)
590 {
591  QLine l(p1, p2);
592  drawLines(&l, 1);
593 }
594 
595 inline void QPainter::drawLine(const QPointF &p1, const QPointF &p2)
596 {
597  drawLine(QLineF(p1, p2));
598 }
599 
600 inline void QPainter::drawLines(const QVector<QLineF> &lines)
601 {
602  drawLines(lines.constData(), lines.size());
603 }
604 
605 inline void QPainter::drawLines(const QVector<QLine> &lines)
606 {
607  drawLines(lines.constData(), lines.size());
608 }
609 
610 inline void QPainter::drawLines(const QVector<QPointF> &pointPairs)
611 {
612  drawLines(pointPairs.constData(), pointPairs.size() / 2);
613 }
614 
615 inline void QPainter::drawLines(const QVector<QPoint> &pointPairs)
616 {
617  drawLines(pointPairs.constData(), pointPairs.size() / 2);
618 }
619 
620 inline void QPainter::drawPolyline(const QPolygonF &polyline)
621 {
622  drawPolyline(polyline.constData(), polyline.size());
623 }
624 
625 inline void QPainter::drawPolyline(const QPolygon &polyline)
626 {
627  drawPolyline(polyline.constData(), polyline.size());
628 }
629 
630 inline void QPainter::drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule)
631 {
632  drawPolygon(polygon.constData(), polygon.size(), fillRule);
633 }
634 
635 inline void QPainter::drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule)
636 {
637  drawPolygon(polygon.constData(), polygon.size(), fillRule);
638 }
639 
640 inline void QPainter::drawConvexPolygon(const QPolygonF &poly)
641 {
642  drawConvexPolygon(poly.constData(), poly.size());
643 }
644 
645 inline void QPainter::drawConvexPolygon(const QPolygon &poly)
646 {
647  drawConvexPolygon(poly.constData(), poly.size());
648 }
649 
650 inline void QPainter::drawRect(const QRectF &rect)
651 {
652  drawRects(&rect, 1);
653 }
654 
655 inline void QPainter::drawRect(int x, int y, int w, int h)
656 {
657  QRect r(x, y, w, h);
658  drawRects(&r, 1);
659 }
660 
661 inline void QPainter::drawRect(const QRect &r)
662 {
663  drawRects(&r, 1);
664 }
665 
666 inline void QPainter::drawRects(const QVector<QRectF> &rects)
667 {
668  drawRects(rects.constData(), rects.size());
669 }
670 
671 inline void QPainter::drawRects(const QVector<QRect> &rects)
672 {
673  drawRects(rects.constData(), rects.size());
674 }
675 
676 inline void QPainter::drawPoint(const QPointF &p)
677 {
678  drawPoints(&p, 1);
679 }
680 
681 inline void QPainter::drawPoint(int x, int y)
682 {
683  QPoint p(x, y);
684  drawPoints(&p, 1);
685 }
686 
687 inline void QPainter::drawPoint(const QPoint &p)
688 {
689  drawPoints(&p, 1);
690 }
691 
692 inline void QPainter::drawPoints(const QPolygonF &points)
693 {
694  drawPoints(points.constData(), points.size());
695 }
696 
697 inline void QPainter::drawPoints(const QPolygon &points)
698 {
699  drawPoints(points.constData(), points.size());
700 }
701 
702 inline void QPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd)
703 {
704  drawRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
705 }
706 
707 inline void QPainter::drawRoundRect(const QRect &rect, int xRnd, int yRnd)
708 {
709  drawRoundRect(QRectF(rect), xRnd, yRnd);
710 }
711 
712 inline void QPainter::drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
713  Qt::SizeMode mode)
714 {
715  drawRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
716 }
717 
718 inline void QPainter::drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
719  Qt::SizeMode mode)
720 {
721  drawRoundedRect(QRectF(rect), xRadius, yRadius, mode);
722 }
723 
724 inline void QPainter::drawEllipse(int x, int y, int w, int h)
725 {
726  drawEllipse(QRect(x, y, w, h));
727 }
728 
729 inline void QPainter::drawEllipse(const QPointF &center, qreal rx, qreal ry)
730 {
731  drawEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
732 }
733 
734 inline void QPainter::drawEllipse(const QPoint &center, int rx, int ry)
735 {
736  drawEllipse(QRect(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
737 }
738 
739 inline void QPainter::drawArc(const QRect &r, int a, int alen)
740 {
741  drawArc(QRectF(r), a, alen);
742 }
743 
744 inline void QPainter::drawArc(int x, int y, int w, int h, int a, int alen)
745 {
746  drawArc(QRectF(x, y, w, h), a, alen);
747 }
748 
749 inline void QPainter::drawPie(const QRect &rect, int a, int alen)
750 {
751  drawPie(QRectF(rect), a, alen);
752 }
753 
754 inline void QPainter::drawPie(int x, int y, int w, int h, int a, int alen)
755 {
756  drawPie(QRectF(x, y, w, h), a, alen);
757 }
758 
759 inline void QPainter::drawChord(const QRect &rect, int a, int alen)
760 {
761  drawChord(QRectF(rect), a, alen);
762 }
763 
764 inline void QPainter::drawChord(int x, int y, int w, int h, int a, int alen)
765 {
766  drawChord(QRectF(x, y, w, h), a, alen);
767 }
768 
769 inline void QPainter::setClipRect(int x, int y, int w, int h, Qt::ClipOperation op)
770 {
771  setClipRect(QRect(x, y, w, h), op);
772 }
773 
774 inline void QPainter::eraseRect(const QRect &rect)
775 {
776  eraseRect(QRectF(rect));
777 }
778 
779 inline void QPainter::eraseRect(int x, int y, int w, int h)
780 {
781  eraseRect(QRectF(x, y, w, h));
782 }
783 
784 inline void QPainter::fillRect(int x, int y, int w, int h, const QBrush &b)
785 {
786  fillRect(QRect(x, y, w, h), b);
787 }
788 
789 inline void QPainter::fillRect(int x, int y, int w, int h, const QColor &b)
790 {
791  fillRect(QRect(x, y, w, h), b);
792 }
793 
794 inline void QPainter::fillRect(int x, int y, int w, int h, Qt::GlobalColor c)
795 {
796  fillRect(QRect(x, y, w, h), QColor(c));
797 }
798 
800 {
801  fillRect(r, QColor(c));
802 }
803 
805 {
806  fillRect(r, QColor(c));
807 }
808 
809 inline void QPainter::fillRect(int x, int y, int w, int h, Qt::BrushStyle style)
810 {
811  fillRect(QRectF(x, y, w, h), QBrush(style));
812 }
813 
814 inline void QPainter::fillRect(const QRect &r, Qt::BrushStyle style)
815 {
816  fillRect(QRectF(r), QBrush(style));
817 }
818 
819 inline void QPainter::fillRect(const QRectF &r, Qt::BrushStyle style)
820 {
821  fillRect(r, QBrush(style));
822 }
823 
824 
825 inline void QPainter::setBrushOrigin(int x, int y)
826 {
827  setBrushOrigin(QPoint(x, y));
828 }
829 
830 inline void QPainter::setBrushOrigin(const QPoint &p)
831 {
832  setBrushOrigin(QPointF(p));
833 }
834 
835 inline void QPainter::drawTiledPixmap(const QRect &rect, const QPixmap &pm, const QPoint &offset)
836 {
837  drawTiledPixmap(QRectF(rect), pm, QPointF(offset));
838 }
839 
840 inline void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap &pm, int sx, int sy)
841 {
842  drawTiledPixmap(QRectF(x, y, w, h), pm, QPointF(sx, sy));
843 }
844 
845 inline void QPainter::drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect)
846 {
847  drawPixmap(QRectF(targetRect), pixmap, QRectF(sourceRect));
848 }
849 
850 inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm)
851 {
852  drawPixmap(QPointF(p), pm);
853 }
854 
855 inline void QPainter::drawPixmap(const QRect &r, const QPixmap &pm)
856 {
857  drawPixmap(QRectF(r), pm, QRectF());
858 }
859 
860 inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm)
861 {
862  drawPixmap(QPointF(x, y), pm);
863 }
864 
865 inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm)
866 {
867  drawPixmap(QRectF(x, y, w, h), pm, QRectF());
868 }
869 
870 inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
871  int sx, int sy, int sw, int sh)
872 {
873  drawPixmap(QRectF(x, y, w, h), pm, QRectF(sx, sy, sw, sh));
874 }
875 
876 inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm,
877  int sx, int sy, int sw, int sh)
878 {
879  drawPixmap(QRectF(x, y, -1, -1), pm, QRectF(sx, sy, sw, sh));
880 }
881 
882 inline void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr)
883 {
884  drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
885 }
886 
887 inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr)
888 {
889  drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
890 }
891 
892 inline void QPainter::drawTextItem(int x, int y, const QTextItem &ti)
893 {
894  drawTextItem(QPointF(x, y), ti);
895 }
896 
897 inline void QPainter::drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
898  Qt::ImageConversionFlags flags)
899 {
900  drawImage(QRectF(targetRect), image, QRectF(sourceRect), flags);
901 }
902 
903 inline void QPainter::drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
904  Qt::ImageConversionFlags flags)
905 {
906  drawImage(QRectF(p.x(), p.y(), -1, -1), image, sr, flags);
907 }
908 
909 inline void QPainter::drawImage(const QPoint &p, const QImage &image, const QRect &sr,
910  Qt::ImageConversionFlags flags)
911 {
912  drawImage(QRect(p.x(), p.y(), -1, -1), image, sr, flags);
913 }
914 
915 
916 inline void QPainter::drawImage(const QRectF &r, const QImage &image)
917 {
918  drawImage(r, image, QRect(0, 0, image.width(), image.height()));
919 }
920 
921 inline void QPainter::drawImage(const QRect &r, const QImage &image)
922 {
923  drawImage(r, image, QRectF(0, 0, image.width(), image.height()));
924 }
925 
926 inline void QPainter::drawImage(const QPoint &p, const QImage &image)
927 {
928  drawImage(QPointF(p), image);
929 }
930 
931 inline void QPainter::drawImage(int x, int y, const QImage &image, int sx, int sy, int sw, int sh,
932  Qt::ImageConversionFlags flags)
933 {
934  if (sx == 0 && sy == 0 && sw == -1 && sh == -1 && flags == Qt::AutoColor)
935  drawImage(QPointF(x, y), image);
936  else
937  drawImage(QRectF(x, y, -1, -1), image, QRectF(sx, sy, sw, sh), flags);
938 }
939 
940 inline void QPainter::drawStaticText(const QPoint &p, const QStaticText &staticText)
941 {
942  drawStaticText(QPointF(p), staticText);
943 }
944 
945 inline void QPainter::drawStaticText(int x, int y, const QStaticText &staticText)
946 {
947  drawStaticText(QPointF(x, y), staticText);
948 }
949 
950 inline void QPainter::drawTextItem(const QPoint &p, const QTextItem &ti)
951 {
952  drawTextItem(QPointF(p), ti);
953 }
954 
955 inline void QPainter::drawText(const QPoint &p, const QString &s)
956 {
957  drawText(QPointF(p), s);
958 }
959 
960 inline void QPainter::drawText(int x, int y, int w, int h, int flags, const QString &str, QRect *br)
961 {
962  drawText(QRect(x, y, w, h), flags, str, br);
963 }
964 
965 inline void QPainter::drawText(int x, int y, const QString &s)
966 {
967  drawText(QPointF(x, y), s);
968 }
969 
970 inline QRect QPainter::boundingRect(int x, int y, int w, int h, int flags, const QString &text)
971 {
972  return boundingRect(QRect(x, y, w, h), flags, text);
973 }
974 
975 inline void QPainter::translate(qreal dx, qreal dy)
976 {
977  translate(QPointF(dx, dy));
978 }
979 
980 inline void QPainter::translate(const QPoint &offset)
981 {
982  translate(offset.x(), offset.y());
983 }
984 
985 inline void QPainter::setViewport(int x, int y, int w, int h)
986 {
987  setViewport(QRect(x, y, w, h));
988 }
989 
990 inline void QPainter::setWindow(int x, int y, int w, int h)
991 {
992  setWindow(QRect(x, y, w, h));
993 }
994 
995 #ifndef QT_NO_PICTURE
996 inline void QPainter::drawPicture(int x, int y, const QPicture &p)
997 {
998  drawPicture(QPoint(x, y), p);
999 }
1000 
1001 inline void QPainter::drawPicture(const QPoint &pt, const QPicture &p)
1002 {
1003  drawPicture(QPointF(pt), p);
1004 }
1005 #endif
1006 
1008 
1010 
1011 #endif // QPAINTER_H
QRectF boundingRect(const QRectF &rect, int flags, const QString &text)
Returns the bounding rectangle of the text as it will appear when drawn inside the given rectangle wi...
Definition: qpainter.cpp:7093
void drawChord(const QRectF &rect, int a, int alen)
Draws the chord defined by the given rectangle, startAngle and spanAngle.
Definition: qpainter.cpp:4744
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
qreal sourceTop
the top coordinate of the source rectangle.
Definition: qpainter.h:108
qreal scaleY
the vertical scale of the target rectangle.
Definition: qpainter.h:112
BrushStyle
Definition: qnamespace.h:1162
static void setWorldTransform(QPainter *painter, const QTransform *const transformPtr, const QTransform *effectTransform)
void drawPie(const QRectF &rect, int a, int alen)
Draws a pie defined by the given rectangle, startAngle and and spanAngle.
Definition: qpainter.cpp:4670
qreal width
the width of the source rectangle and is used to calculate the width of the target rectangle...
Definition: qpainter.h:109
double qreal
Definition: qglobal.h:1193
void drawArc(const QRectF &rect, int a, int alen)
Draws the arc defined by the given rectangle, startAngle and spanAngle.
Definition: qpainter.cpp:4602
The QStaticText class enables optimized drawing of text when the text and its layout is updated rarel...
Definition: qstatictext.h:60
unsigned char c[8]
Definition: qnumeric_p.h:62
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void drawRoundRect(const QRectF &r, int xround=25, int yround=25)
Draws a rectangle r with rounded corners.
Definition: qpainter.cpp:4414
QPointer< QWidget > widget
#define QT_MODULE(x)
Definition: qglobal.h:2783
CompositionMode
Defines the modes supported for digital image compositing.
Definition: qpainter.h:138
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:57
void drawPoints(const QPointF *points, int pointCount)
Draws the first pointCount points in the array points using the current pen&#39;s color.
Definition: qpainter.cpp:3816
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
Definition: qglobal.h:2348
void setViewport(const QRect &viewport)
Sets the painter&#39;s viewport rectangle to the given rectangle, and enables view transformations.
Definition: qpainter.cpp:7815
The QMatrix class specifies 2D transformations of a coordinate system.
Definition: qmatrix.h:61
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
Definition: qpainter.cpp:2801
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
FillRule
Definition: qnamespace.h:1485
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
long ASN1_INTEGER_get ASN1_INTEGER * a
The QPolygon class provides a vector of points using integer precision.
Definition: qpolygon.h:60
void drawLine(const QLineF &line)
Draws a line defined by line.
Definition: qpainter.h:573
bool testRenderHint(RenderHint hint) const
Returns true if hint is set; otherwise returns false.
Definition: qpainter.h:457
The QString class provides a Unicode character string.
Definition: qstring.h:83
qreal opacity
the opacity of the target rectangle, where 0.0 is fully transparent and 1.0 is fully opaque...
Definition: qpainter.h:114
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
qreal rotation
the rotation of the target rectangle in degrees.
Definition: qpainter.h:113
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
void setBrushOrigin(int x, int y)
Sets the brush&#39;s origin to point (x, y).
Definition: qpainter.h:825
void drawPoint(const QPointF &pt)
Draws a single point at the given position using the current pen&#39;s color.
Definition: qpainter.h:676
PenStyle
Definition: qnamespace.h:1134
GlobalColor
Definition: qnamespace.h:104
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
static const QRectF boundingRect(const QPointF *points, int pointCount)
NSWindow * window
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
Definition: qpainter.cpp:6231
void drawRects(const QRectF *rects, int rectCount)
Draws the first rectCount of the given rectangles using the current pen and brush.
Definition: qpainter.cpp:3641
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
Definition: qpainter.cpp:4464
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
qreal y
the y coordinate of the center point in the target rectangle.
Definition: qpainter.h:106
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
Definition: qglobal.h:2355
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
Definition: qpainter.cpp:4873
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
void drawPicture(const QPointF &p, const QPicture &picture)
Replays the given picture at the given point.
Definition: qpainter.cpp:7282
void drawConvexPolygon(const QPointF *points, int pointCount)
Draws the convex polygon defined by the first pointCount points in the array points using the current...
Definition: qpainter.cpp:5484
static bool init
static void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
qreal x
the x coordinate of center point in the target rectangle.
Definition: qpainter.h:105
LayoutDirection
Definition: qnamespace.h:1580
The QPolygonF class provides a vector of points using floating point precision.
Definition: qpolygon.h:134
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
RenderHint
Renderhints are used to specify flags to QPainter that may or may not be respected by any given engin...
Definition: qpainter.h:93
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
Definition: qpainter.cpp:5205
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
The QGlyphRun class provides direct access to the internal glyphs in a font.
Definition: qglyphrun.h:59
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
Definition: qpaintengine.h:90
The QFontInfo class provides general information about fonts.
Definition: qfontinfo.h:54
void setWindow(const QRect &window)
Sets the painter&#39;s window to the given rectangle, and enables view transformations.
Definition: qpainter.cpp:7745
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
#define Q_GADGET
Definition: qobjectdefs.h:173
void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset=QPointF())
Draws a tiled pixmap, inside the given rectangle with its origin at the given position.
Definition: qpainter.cpp:7146
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText)
Draws the given staticText at the given topLeftPosition.
Definition: qpainter.cpp:6260
This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a ...
Definition: qpainter.h:103
qreal scaleX
the horizontal scale of the target rectangle.
Definition: qpainter.h:111
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
Definition: qpainter.cpp:7332
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
void drawTextItem(const QPointF &p, const QTextItem &ti)
Draws the text item ti at position p.
Definition: qpainter.cpp:6864
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QFactoryLoader * l
The QTextOption class provides a description of general rich text properties.
Definition: qtextoption.h:59
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
Definition: qpainter.h:650
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
static void drawPoints(const T *points, int n, const QTransform &transform, IDirectFBSurface *surface)
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Definition: qpainter.cpp:5936
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
quint16 index
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
PixmapFragmentHint
Definition: qpainter.h:120
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
Definition: qpainter.cpp:5619
#define Q_FLAGS(x)
Definition: qobjectdefs.h:85
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
const T * constData() const
Returns a const pointer to the data stored in the vector.
Definition: qvector.h:154
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
SizeMode
Definition: qnamespace.h:1187
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
static void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface)
The QTextItem class provides all the information required to draw text in a custom paint engine...
Definition: qpaintengine.h:68
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
Draws the given rectangle rect with rounded corners.
Definition: qpainter.cpp:4348
qreal sourceLeft
the left coordinate of the source rectangle.
Definition: qpainter.h:107
#define class
static const KeyPair *const end
The QPicture class is a paint device that records and replays QPainter commands.
Definition: qpicture.h:58
void drawPolyline(const QPointF *points, int pointCount)
Draws the polyline defined by the first pointCount points in points using the current pen...
Definition: qpainter.cpp:5055
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define QT_END_HEADER
Definition: qglobal.h:137
qreal height
the height of the source rectangle and is used to calculate the height of the target rectangle...
Definition: qpainter.h:110
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
BGMode
Definition: qnamespace.h:588
#define enabled
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
Definition: qpainter.cpp:7420
#define text
Definition: qobjectdefs.h:80
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
ClipOperation
Definition: qnamespace.h:1495
Qt::LayoutDirection direction
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
Definition: qpainter.cpp:3311