7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qnamespace.h>
9#include <QtCore/qrect.h>
10#include <QtCore/qpoint.h>
11#include <QtCore/qscopedpointer.h>
12#include <QtGui/qpixmap.h>
13#include <QtGui/qimage.h>
14#include <QtGui/qtextoption.h>
17#ifndef QT_INCLUDE_COMPAT
18#include <QtGui/qpolygon.h>
19#include <QtGui/qpen.h>
20#include <QtGui/qbrush.h>
21#include <QtGui/qtransform.h>
22#include <QtGui/qfontinfo.h>
23#include <QtGui/qfontmetrics.h>
43class QPainterPrivateDeleter;
53 TextAntialiasing = 0x02,
54 SmoothPixmapTransform = 0x04,
55 VerticalSubpixelPositioning = 0x08,
56 LosslessImageRendering = 0x40,
57 NonCosmeticBrushPatterns = 0x80
139 RasterOp_NotDestination
141 void setCompositionMode(CompositionMode
mode);
142 CompositionMode compositionMode()
const;
145 void setFont(
const QFont &
f);
151 void setPen(
const QPen &pen);
153 const QPen &pen()
const;
163 QPoint brushOrigin()
const;
164 inline void setBrushOrigin(
int x,
int y);
165 inline void setBrushOrigin(
const QPoint &);
166 void setBrushOrigin(
const QPointF &);
168 void setBackground(
const QBrush &bg);
169 const QBrush &background()
const;
171 qreal opacity()
const;
172 void setOpacity(
qreal opacity);
186 void setClipping(
bool enable);
187 bool hasClipping()
const;
189 QRectF clipBoundingRect()
const;
198 void resetTransform();
205 void setWorldMatrixEnabled(
bool enabled);
206 bool worldMatrixEnabled()
const;
218 inline void setWindow(
int x,
int y,
int w,
int h);
222 inline void setViewport(
int x,
int y,
int w,
int h);
224 void setViewTransformEnabled(
bool enable);
225 bool viewTransformEnabled()
const;
232 inline void drawPoint(
const QPointF &pt);
233 inline void drawPoint(
const QPoint &
p);
234 inline void drawPoint(
int x,
int y);
247 void drawLines(
const QLineF *lines,
int lineCount);
249 void drawLines(
const QPointF *pointPairs,
int lineCount);
251 void drawLines(
const QLine *lines,
int lineCount);
253 void drawLines(
const QPoint *pointPairs,
int lineCount);
257 inline void drawRect(
int x1,
int y1,
int w,
int h);
260 void drawRects(
const QRectF *rects,
int rectCount);
262 void drawRects(
const QRect *rects,
int rectCount);
265 void drawEllipse(
const QRectF &
r);
266 void drawEllipse(
const QRect &
r);
267 inline void drawEllipse(
int x,
int y,
int w,
int h);
270 inline void drawEllipse(
const QPoint ¢er,
int rx,
int ry);
273 inline void drawPolyline(
const QPolygonF &polyline);
274 void drawPolyline(
const QPoint *
points,
int pointCount);
282 void drawConvexPolygon(
const QPointF *
points,
int pointCount);
284 void drawConvexPolygon(
const QPoint *
points,
int pointCount);
288 inline void drawArc(
const QRect &,
int a,
int alen);
289 inline void drawArc(
int x,
int y,
int w,
int h,
int a,
int alen);
292 inline void drawPie(
int x,
int y,
int w,
int h,
int a,
int alen);
293 inline void drawPie(
const QRect &,
int a,
int alen);
295 void drawChord(
const QRectF &
rect,
int a,
int alen);
296 inline void drawChord(
int x,
int y,
int w,
int h,
int a,
int alen);
297 inline void drawChord(
const QRect &,
int a,
int alen);
301 inline void drawRoundedRect(
int x,
int y,
int w,
int h,
qreal xRadius,
qreal yRadius,
307 inline void drawTiledPixmap(
int x,
int y,
int w,
int h,
const QPixmap &,
int sx=0,
int sy=0);
317 inline void drawPixmap(
int x,
int y,
int w,
int h,
const QPixmap &pm,
318 int sx,
int sy,
int sw,
int sh);
319 inline void drawPixmap(
int x,
int y,
const QPixmap &pm,
320 int sx,
int sy,
int sw,
int sh);
325 inline void drawPixmap(
int x,
int y,
const QPixmap &pm);
327 inline void drawPixmap(
int x,
int y,
int w,
int h,
const QPixmap &pm);
329 void drawPixmapFragments(
const PixmapFragment *fragments,
int fragmentCount,
330 const QPixmap &
pixmap, PixmapFragmentHints hints = PixmapFragmentHints());
350#if !defined(QT_NO_RAWFONT)
355 inline void drawStaticText(
const QPoint &topLeftPosition,
const QStaticText &staticText);
377 inline void drawTextItem(
int x,
int y,
const QTextItem &ti);
381 inline void fillRect(
int x,
int y,
int w,
int h,
const QBrush &);
400 void eraseRect(
const QRectF &);
401 inline void eraseRect(
int x,
int y,
int w,
int h);
402 inline void eraseRect(
const QRect &);
404 void setRenderHint(RenderHint
hint,
bool on =
true);
406 RenderHints renderHints()
const;
411 void beginNativePainting();
412 void endNativePainting();
417 std::unique_ptr<QPainterPrivate> d_ptr;
423 friend class QFontEngineMac;
424 friend class QFontEngineWin;
427 friend class QOpenGLPaintEngine;
428 friend class QWin32PaintEngine;
429 friend class QWin32PaintEnginePrivate;
744 int sx,
int sy,
int sw,
int sh)
750 int sx,
int sy,
int sw,
int sh)
771 Qt::ImageConversionFlags
flags)
777 Qt::ImageConversionFlags
flags)
783 Qt::ImageConversionFlags
flags)
805 Qt::ImageConversionFlags
flags)
IOBluetoothDevice * device
The QColor class provides colors based on RGB, HSV or CMYK values.
\reentrant \inmodule QtGui
The QGlyphRun class provides direct access to the internal glyphs in a font.
qsizetype size() const noexcept
const_pointer constData() const noexcept
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)
Draws a single point at the given position using the current pen's color.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
void drawConvexPolygon(const QPointF *points, int pointCount)
Draws the convex polygon defined by the first pointCount points in the array points using the current...
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.
void drawPie(const QRectF &rect, int a, int alen)
Draws a pie defined by the given rectangle, startAngle and spanAngle.
PixmapFragmentHint
\variable QPainter::PixmapFragment::x
void drawLine(const QLineF &line)
Draws a line defined by line.
void setViewport(const QRect &viewport)
Sets the painter's viewport rectangle to the given rectangle, and enables view transformations.
void drawTextItem(const QPointF &p, const QTextItem &ti)
void drawChord(const QRectF &rect, int a, int alen)
Draws the chord defined by the given rectangle, startAngle and spanAngle.
void setBrushOrigin(int x, int y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawRects(const QRectF *rects, int rectCount)
Draws the first rectCount of the given rectangles using the current pen and brush.
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.
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
void drawPolyline(const QPointF *points, int pointCount)
Draws the polyline defined by the first pointCount points in points using the current pen.
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.
void drawArc(const QRectF &rect, int a, int alen)
Draws the arc defined by the given rectangle, startAngle and spanAngle.
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
RenderHint
Renderhints are used to specify flags to QPainter that may or may not be respected by any given engin...
void drawPicture(const QPointF &p, const QPicture &picture)
Replays the given picture at the given point.
void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText)
void drawPoints(const QPointF *points, int pointCount)
Draws the first pointCount points in the array points using the current pen's color.
CompositionMode
Defines the modes supported for digital image compositing.
@ 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)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
void setWindow(const QRect &window)
Sets the painter's window to the given rectangle, and enables view transformations.
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
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...
bool testRenderHint(RenderHint hint) const
The QPicture class is a paint device that records and replays QPainter commands.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QPolygonF class provides a list of points using floating point precision.
The QPolygon class provides a list of points using integer precision.
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
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...
\macro QT_RESTRICTED_CAST_FROM_ASCII
paint drawText(0, 50, "Hi")
Combined button and popup list for selecting options.
static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
static void setWorldTransform(QPainter *painter, const QTransform *const transformPtr, const QTransform *effectTransform)
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
static const QRectF boundingRect(const QPointF *points, int pointCount)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)
p drawImage(offset, thumbnail)
view viewport() -> scroll(dx, dy, deviceRect)
rect deviceTransform(view->viewportTransform()).map(QPointF(0
view setRenderHints(QPainter::Antialiasing|QPainter::SmoothPixmapTransform)