43 #include <QtGui/qtguiglobal.h>
44 #include <QtCore/qnamespace.h>
45 #include <QtCore/qrect.h>
46 #include <QtCore/qpoint.h>
47 #include <QtCore/qscopedpointer.h>
48 #include <QtGui/qpixmap.h>
49 #include <QtGui/qimage.h>
50 #include <QtGui/qtextoption.h>
53 #ifndef QT_INCLUDE_COMPAT
54 #include <QtGui/qpolygon.h>
55 #include <QtGui/qpen.h>
56 #include <QtGui/qbrush.h>
57 #include <QtGui/qtransform.h>
58 #include <QtGui/qfontinfo.h>
59 #include <QtGui/qfontmetrics.h>
79 class QPainterPrivateDeleter;
89 TextAntialiasing = 0x02,
90 SmoothPixmapTransform = 0x04,
91 VerticalSubpixelPositioning = 0x08,
92 LosslessImageRendering = 0x40,
174 RasterOp_NotDestination
176 void setCompositionMode(CompositionMode
mode);
177 CompositionMode compositionMode()
const;
186 void setPen(
const QPen &pen);
188 const QPen &pen()
const;
198 QPoint brushOrigin()
const;
199 inline void setBrushOrigin(
int x,
int y);
200 inline void setBrushOrigin(
const QPoint &);
201 void setBrushOrigin(
const QPointF &);
203 void setBackground(
const QBrush &bg);
204 const QBrush &background()
const;
206 qreal opacity()
const;
207 void setOpacity(
qreal opacity);
221 void setClipping(
bool enable);
222 bool hasClipping()
const;
224 QRectF clipBoundingRect()
const;
233 void resetTransform();
240 void setWorldMatrixEnabled(
bool enabled);
241 bool worldMatrixEnabled()
const;
253 inline void setWindow(
int x,
int y,
int w,
int h);
257 inline void setViewport(
int x,
int y,
int w,
int h);
259 void setViewTransformEnabled(
bool enable);
260 bool viewTransformEnabled()
const;
267 inline void drawPoint(
const QPointF &pt);
268 inline void drawPoint(
const QPoint &
p);
269 inline void drawPoint(
int x,
int y);
278 inline void drawLine(
int x1,
int y1,
int x2,
int y2);
282 void drawLines(
const QLineF *lines,
int lineCount);
284 void drawLines(
const QPointF *pointPairs,
int lineCount);
286 void drawLines(
const QLine *lines,
int lineCount);
288 void drawLines(
const QPoint *pointPairs,
int lineCount);
292 inline void drawRect(
int x1,
int y1,
int w,
int h);
295 void drawRects(
const QRectF *rects,
int rectCount);
297 void drawRects(
const QRect *rects,
int rectCount);
300 void drawEllipse(
const QRectF &
r);
301 void drawEllipse(
const QRect &
r);
302 inline void drawEllipse(
int x,
int y,
int w,
int h);
308 inline void drawPolyline(
const QPolygonF &polyline);
309 void drawPolyline(
const QPoint *
points,
int pointCount);
317 void drawConvexPolygon(
const QPointF *
points,
int pointCount);
319 void drawConvexPolygon(
const QPoint *
points,
int pointCount);
323 inline void drawArc(
const QRect &,
int a,
int alen);
324 inline void drawArc(
int x,
int y,
int w,
int h,
int a,
int alen);
327 inline void drawPie(
int x,
int y,
int w,
int h,
int a,
int alen);
328 inline void drawPie(
const QRect &,
int a,
int alen);
330 void drawChord(
const QRectF &
rect,
int a,
int alen);
331 inline void drawChord(
int x,
int y,
int w,
int h,
int a,
int alen);
332 inline void drawChord(
const QRect &,
int a,
int alen);
336 inline void drawRoundedRect(
int x,
int y,
int w,
int h,
qreal xRadius,
qreal yRadius,
342 inline void drawTiledPixmap(
int x,
int y,
int w,
int h,
const QPixmap &,
int sx=0,
int sy=0);
344 #ifndef QT_NO_PICTURE
352 inline void drawPixmap(
int x,
int y,
int w,
int h,
const QPixmap &pm,
353 int sx,
int sy,
int sw,
int sh);
354 inline void drawPixmap(
int x,
int y,
const QPixmap &pm,
355 int sx,
int sy,
int sw,
int sh);
360 inline void drawPixmap(
int x,
int y,
const QPixmap &pm);
362 inline void drawPixmap(
int x,
int y,
int w,
int h,
const QPixmap &pm);
364 void drawPixmapFragments(
const PixmapFragment *fragments,
int fragmentCount,
365 const QPixmap &
pixmap, PixmapFragmentHints hints = PixmapFragmentHints());
385 #if !defined(QT_NO_RAWFONT)
390 inline void drawStaticText(
const QPoint &topLeftPosition,
const QStaticText &staticText);
412 inline void drawTextItem(
int x,
int y,
const QTextItem &ti);
435 void eraseRect(
const QRectF &);
436 inline void eraseRect(
int x,
int y,
int w,
int h);
437 inline void eraseRect(
const QRect &);
439 void setRenderHint(RenderHint hint,
bool on =
true);
441 RenderHints renderHints()
const;
446 void beginNativePainting();
447 void endNativePainting();
452 std::unique_ptr<QPainterPrivate> d_ptr;
458 friend class QFontEngineMac;
459 friend class QFontEngineWin;
462 friend class QOpenGLPaintEngine;
463 friend class QWin32PaintEngine;
464 friend class QWin32PaintEnginePrivate;
779 int sx,
int sy,
int sw,
int sh)
785 int sx,
int sy,
int sw,
int sh)
806 Qt::ImageConversionFlags
flags)
812 Qt::ImageConversionFlags
flags)
818 Qt::ImageConversionFlags
flags)
840 Qt::ImageConversionFlags
flags)
903 #ifndef QT_NO_PICTURE
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QFont class specifies a query for a font used for drawing text.
The QFontInfo class provides general information about fonts. \inmodule QtGui.
The QFontMetrics class provides font metrics information.
The QGlyphRun class provides direct access to the internal glyphs in a font.
The QGradient class is used in combination with QBrush to specify gradient fills.
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QLineF class provides a two-dimensional vector using floating point precision.
The QLine class provides a two-dimensional vector using integer precision.
qsizetype size() const noexcept
const_pointer constData() const noexcept
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
This class is used in conjunction with the QPainter::drawPixmapFragments() function to specify how a ...
The QPainter class performs low-level painting on widgets and other paint devices.
void drawPoint(const QPointF &pt)
void drawRect(const QRectF &rect)
void drawConvexPolygon(const QPointF *points, int pointCount)
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
void drawPie(const QRectF &rect, int a, int alen)
PixmapFragmentHint
the x coordinate of center point in the target rectangle.
void drawLine(const QLineF &line)
void setViewport(const QRect &viewport)
void drawTextItem(const QPointF &p, const QTextItem &ti)
void drawChord(const QRectF &rect, int a, int alen)
void setBrushOrigin(int x, int y)
void drawRects(const QRectF *rects, int rectCount)
void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset=QPointF())
void drawLines(const QLineF *lines, int lineCount)
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
void drawText(const QPointF &p, const QString &s)
void drawPolyline(const QPointF *points, int pointCount)
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
void drawArc(const QRectF &rect, int a, int alen)
void eraseRect(const QRectF &)
void drawEllipse(const QRectF &r)
void drawPicture(const QPointF &p, const QPicture &picture)
void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText)
void drawPoints(const QPointF *points, int pointCount)
@ RasterOp_SourceAndNotDestination
@ CompositionMode_Destination
@ RasterOp_NotSourceAndNotDestination
@ CompositionMode_Lighten
@ CompositionMode_ColorDodge
@ CompositionMode_DestinationAtop
@ CompositionMode_SourceOver
@ RasterOp_SourceOrNotDestination
@ RasterOp_NotSourceOrNotDestination
@ RasterOp_SourceXorDestination
@ CompositionMode_DestinationOut
@ CompositionMode_SourceAtop
@ RasterOp_NotSourceAndDestination
@ CompositionMode_Overlay
@ RasterOp_SourceOrDestination
@ RasterOp_ClearDestination
@ RasterOp_NotSourceOrDestination
@ CompositionMode_Multiply
@ CompositionMode_DestinationOver
@ CompositionMode_HardLight
@ CompositionMode_Exclusion
@ CompositionMode_ColorBurn
@ RasterOp_NotSourceXorDestination
@ CompositionMode_Difference
@ CompositionMode_SoftLight
@ CompositionMode_DestinationIn
@ CompositionMode_SourceOut
@ RasterOp_SourceAndDestination
@ CompositionMode_SourceIn
@ RasterOp_SetDestination
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
void translate(const QPointF &offset)
void fillRect(const QRectF &, const QBrush &)
void setWindow(const QRect &window)
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
QRectF boundingRect(const QRectF &rect, int flags, const QString &text)
bool testRenderHint(RenderHint hint) const
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QPicture class is a paint device that records and replays QPainter commands.
The QPixmap class is an off-screen image representation that can be used as a paint device.
The QPointF class defines a point in the plane using floating point precision.
The QPoint class defines a point in the plane using integer precision.
The QPolygonF class provides a list of points using floating point precision. \inmodule QtGui.
The QPolygon class provides a list of points using integer precision. \inmodule QtGui.
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
The QRegion class specifies a clip region for a painter.
The QStaticText class enables optimized drawing of text when the text and its layout is updated rarel...
The QString class provides a Unicode character string.
The QTextItem class provides all the information required to draw text in a custom paint engine.
The QTextOption class provides a description of general rich text properties. \inmodule QtGui.
paint drawText(0, 50, "Hi")
auto it unsigned count const
QHighDpiScaling::Point position(T, QHighDpiScaling::Point::Kind)
QTextStream & center(QTextStream &stream)
QRectF fillRect(QRect rect, int background)
set set set set set set set macro pixldst1 op
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
QT_END_INCLUDE_NAMESPACE typedef double qreal
#define Q_DISABLE_COPY(Class)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLfixed GLfixed GLint GLint GLfixed points
GLfixed GLfixed GLfixed y2
GLsizei const GLchar *const * path
GLenum GLenum GLenum GLenum GLenum scale
Q_DECLARE_TYPEINFO(QPainter::PixmapFragment, Q_RELOCATABLE_TYPE)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
p drawImage(offset, thumbnail)
item setTransform(QTransform().translate(x, y).rotate(45).translate(-x, -y))
view viewport() -> scroll(dx, dy, deviceRect)
rect deviceTransform(view->viewportTransform()).map(QPointF(0
rect rect item rotate(45)
[5]
view setRenderHints(QPainter::Antialiasing|QPainter::SmoothPixmapTransform)