Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QPaintEngine Class Referenceabstract

\inmodule QtGui More...

#include <qpaintengine.h>

+ Inheritance diagram for QPaintEngine:
+ Collaboration diagram for QPaintEngine:

Public Types

enum  PaintEngineFeature {
  PrimitiveTransform = 0x00000001 , PatternTransform = 0x00000002 , PixmapTransform = 0x00000004 , PatternBrush = 0x00000008 ,
  LinearGradientFill = 0x00000010 , RadialGradientFill = 0x00000020 , ConicalGradientFill = 0x00000040 , AlphaBlend = 0x00000080 ,
  PorterDuff = 0x00000100 , PainterPaths = 0x00000200 , Antialiasing = 0x00000400 , BrushStroke = 0x00000800 ,
  ConstantOpacity = 0x00001000 , MaskedBrush = 0x00002000 , PerspectiveTransform = 0x00004000 , BlendModes = 0x00008000 ,
  ObjectBoundingModeGradients = 0x00010000 , RasterOpModes = 0x00020000 , PaintOutsidePaintEvent = 0x20000000 , AllFeatures = 0xffffffff
}
 This enum is used to describe the features or capabilities that the paint engine has. More...
 
enum  DirtyFlag {
  DirtyPen = 0x0001 , DirtyBrush = 0x0002 , DirtyBrushOrigin = 0x0004 , DirtyFont = 0x0008 ,
  DirtyBackground = 0x0010 , DirtyBackgroundMode = 0x0020 , DirtyTransform = 0x0040 , DirtyClipRegion = 0x0080 ,
  DirtyClipPath = 0x0100 , DirtyHints = 0x0200 , DirtyCompositionMode = 0x0400 , DirtyClipEnabled = 0x0800 ,
  DirtyOpacity = 0x1000 , AllDirty = 0xffff
}
 \value DirtyPen The pen is dirty and needs to be updated. More...
 
enum  PolygonDrawMode { OddEvenMode , WindingMode , ConvexMode , PolylineMode }
 \value OddEvenMode The polygon should be drawn using OddEven fill rule. More...
 
enum  Type {
  X11 , Windows , QuickDraw , CoreGraphics ,
  MacPrinter , QWindowSystem , OpenGL , Picture ,
  SVG , Raster , Direct3D , Pdf ,
  OpenVG , OpenGL2 , PaintBuffer , Blitter ,
  Direct2D , User = 50 , MaxUser = 100
}
 \value X11 \value Windows \value MacPrinter \value CoreGraphics \macos's Quartz2D (CoreGraphics) \value QuickDraw \macos's QuickDraw \value QWindowSystem Qt for Embedded Linux \value OpenGL \value Picture QPicture format \value SVG Scalable Vector Graphics XML format \value Raster \value Direct3D Windows only, Direct3D based engine \value Pdf Portable Document Format \value OpenVG \value User First user type ID \value MaxUser Last user type ID \value OpenGL2 \value PaintBuffer \value Blitter \value Direct2D Windows only, Direct2D based engine More...
 

Public Member Functions

 QPaintEngine (PaintEngineFeatures features=PaintEngineFeatures())
 Creates a paint engine with the featureset specified by caps.
 
virtual ~QPaintEngine ()
 Destroys the paint engine.
 
bool isActive () const
 Returns true if the paint engine is actively drawing; otherwise returns false.
 
void setActive (bool newState)
 Sets the active state of the paint engine to state.
 
virtual bool begin (QPaintDevice *pdev)=0
 Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev.
 
virtual bool end ()=0
 Reimplement this function to finish painting on the current paint device.
 
virtual void updateState (const QPaintEngineState &state)=0
 Reimplement this function to update the state of a paint engine.
 
virtual void drawRects (const QRect *rects, int rectCount)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function.
 
virtual void drawRects (const QRectF *rects, int rectCount)
 Draws the first rectCount rectangles in the buffer rects.
 
virtual void drawLines (const QLine *lines, int lineCount)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function.
 
virtual void drawLines (const QLineF *lines, int lineCount)
 The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine.
 
virtual void drawEllipse (const QRectF &r)
 Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
 
virtual void drawEllipse (const QRect &r)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation of this function calls the floating point version of this function.
 
virtual void drawPath (const QPainterPath &path)
 The default implementation ignores the path and does nothing.
 
virtual void drawPoints (const QPointF *points, int pointCount)
 Draws the first pointCount points in the buffer points.
 
virtual void drawPoints (const QPoint *points, int pointCount)
 Draws the first pointCount points in the buffer points.
 
virtual void drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode)
 Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.
 
virtual void drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.
 
virtual void drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr)=0
 Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
 
virtual void drawTextItem (const QPointF &p, const QTextItem &textItem)
 This function draws the text item textItem at position p.
 
virtual void drawTiledPixmap (const QRectF &r, const QPixmap &pixmap, const QPointF &s)
 Reimplement this function to draw the pixmap in the given rect, starting at the given p.
 
virtual void drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap.
 
void setPaintDevice (QPaintDevice *device)
 
QPaintDevicepaintDevice () const
 Returns the device that this engine is painting on, if painting is active; otherwise returns \nullptr.
 
void setSystemClip (const QRegion &baseClip)
 
QRegion systemClip () const
 
void setSystemRect (const QRect &rect)
 
QRect systemRect () const
 
virtual QPoint coordinateOffset () const
 
virtual Type type () const =0
 Reimplement this function to return the paint engine \l{Type}.
 
void fix_neg_rect (int *x, int *y, int *w, int *h)
 
bool testDirty (DirtyFlags df)
 
void setDirty (DirtyFlags df)
 
void clearDirty (DirtyFlags df)
 
bool hasFeature (PaintEngineFeatures feature) const
 Returns true if the paint engine supports the specified feature; otherwise returns false.
 
QPainterpainter () const
 Returns the paint engine's painter.
 
void syncState ()
 
bool isExtended () const
 
virtual QPixmap createPixmap (QSize size)
 
virtual QPixmap createPixmapFromImage (QImage image, Qt::ImageConversionFlags flags=Qt::AutoColor)
 

Protected Member Functions

 QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures())
 

Protected Attributes

QPaintEngineStatestate
 
PaintEngineFeatures gccaps
 
uint active: 1
 
uint selfDestruct: 1
 
uint extended: 1
 
QScopedPointer< QPaintEnginePrivated_ptr
 

Friends

class QPainterReplayer
 
class QFontEngineBox
 
class QFontEngineMac
 
class QFontEngineWin
 
class QMacPrintEngine
 
class QMacPrintEnginePrivate
 
class QFontEngineQPF2
 
class QPainter
 
class QPainterPrivate
 
class QWidget
 
class QWidgetPrivate
 
class QWin32PaintEngine
 
class QWin32PaintEnginePrivate
 
class QMacCGContext
 
class QPreviewPaintEngine
 
class QX11GLPlatformPixmap
 

Detailed Description

\inmodule QtGui

The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform.

Qt provides several premade implementations of QPaintEngine for the different painter backends we support. The primary paint engine provided is the raster paint engine, which contains a software rasterizer which supports the full feature set on all supported platforms. This is the default for painting on QWidget-based classes in e.g. on Windows, X11 and \macos, it is the backend for painting on QImage and it is used as a fallback for paint engines that do not support a certain capability. In addition we provide QPaintEngine implementations for OpenGL (accessible through QOpenGLWidget) and printing (which allows using QPainter to draw on a QPrinter object).

If one wants to use QPainter to draw to a different backend, one must subclass QPaintEngine and reimplement all its virtual functions. The QPaintEngine implementation is then made available by subclassing QPaintDevice and reimplementing the virtual function QPaintDevice::paintEngine().

QPaintEngine is created and owned by the QPaintDevice that created it.

See also
QPainter, QPaintDevice::paintEngine(), {Paint System}

Definition at line 50 of file qpaintengine.h.

Member Enumeration Documentation

◆ DirtyFlag

\value DirtyPen The pen is dirty and needs to be updated.

\value DirtyBrush The brush is dirty and needs to be updated.

\value DirtyBrushOrigin The brush origin is dirty and needs to updated.

\value DirtyFont The font is dirty and needs to be updated.

\value DirtyBackground The background is dirty and needs to be updated.

\value DirtyBackgroundMode The background mode is dirty and needs to be updated.

\value DirtyTransform The transform is dirty and needs to be updated.

\value DirtyClipRegion The clip region is dirty and needs to be updated.

\value DirtyClipPath The clip path is dirty and needs to be updated.

\value DirtyHints The render hints is dirty and needs to be updated.

\value DirtyCompositionMode The composition mode is dirty and needs to be updated.

\value DirtyClipEnabled Whether clipping is enabled or not is dirty and needs to be updated.

\value DirtyOpacity The constant opacity has changed and needs to be updated as part of the state change in QPaintEngine::updateState().

\value AllDirty Convenience enum used internally.

These types are used by QPainter to trigger lazy updates of the various states in the QPaintEngine using QPaintEngine::updateState().

A paint engine must update every dirty state.

Enumerator
DirtyPen 
DirtyBrush 
DirtyBrushOrigin 
DirtyFont 
DirtyBackground 
DirtyBackgroundMode 
DirtyTransform 
DirtyClipRegion 
DirtyClipPath 
DirtyHints 
DirtyCompositionMode 
DirtyClipEnabled 
DirtyOpacity 
AllDirty 

Definition at line 85 of file qpaintengine.h.

◆ PaintEngineFeature

This enum is used to describe the features or capabilities that the paint engine has.

If a feature is not supported by the engine, QPainter will do a best effort to emulate that feature through other means and pass on an alpha blended QImage to the engine with the emulated results. Some features cannot be emulated: AlphaBlend and PorterDuff.

\value AlphaBlend The engine can alpha blend primitives. \value Antialiasing The engine can use antialiasing to improve the appearance of rendered primitives. \value BlendModes The engine supports blending modes. \value BrushStroke The engine supports drawing strokes that contain brushes as fills, not just solid colors (e.g. a dashed gradient line of width 2). \value ConicalGradientFill The engine supports conical gradient fills. \value ConstantOpacity The engine supports the feature provided by QPainter::setOpacity(). \value LinearGradientFill The engine supports linear gradient fills. \value MaskedBrush The engine is capable of rendering brushes that has a texture with an alpha channel or a mask. \value ObjectBoundingModeGradients The engine has native support for gradients with coordinate mode QGradient::ObjectBoundingMode. Otherwise, if QPaintEngine::PatternTransform is supported, object bounding mode gradients are converted to gradients with coordinate mode QGradient::LogicalMode and a brush transform for the coordinate mapping. \value PainterPaths The engine has path support. \value PaintOutsidePaintEvent The engine is capable of painting outside of paint events. \value PatternBrush The engine is capable of rendering brushes with the brush patterns specified in Qt::BrushStyle. \value PatternTransform The engine has support for transforming brush patterns. \value PerspectiveTransform The engine has support for performing perspective transformations on primitives. \value PixmapTransform The engine can transform pixmaps, including rotation and shearing. \value PorterDuff The engine supports Porter-Duff operations \value PrimitiveTransform The engine has support for transforming drawing primitives. \value RadialGradientFill The engine supports radial gradient fills. \value RasterOpModes The engine supports bitwise raster operations. \value AllFeatures All of the above features. This enum value is usually used as a bit mask.

Enumerator
PrimitiveTransform 
PatternTransform 
PixmapTransform 
PatternBrush 
LinearGradientFill 
RadialGradientFill 
ConicalGradientFill 
AlphaBlend 
PorterDuff 
PainterPaths 
Antialiasing 
BrushStroke 
ConstantOpacity 
MaskedBrush 
PerspectiveTransform 
BlendModes 
ObjectBoundingModeGradients 
RasterOpModes 
PaintOutsidePaintEvent 
AllFeatures 

Definition at line 54 of file qpaintengine.h.

◆ PolygonDrawMode

\value OddEvenMode The polygon should be drawn using OddEven fill rule.

\value WindingMode The polygon should be drawn using Winding fill rule.

\value ConvexMode The polygon is a convex polygon and can be drawn using specialized algorithms where available.

\value PolylineMode Only the outline of the polygon should be drawn.

Enumerator
OddEvenMode 
WindingMode 
ConvexMode 
PolylineMode 

Definition at line 104 of file qpaintengine.h.

◆ Type

\value X11 \value Windows \value MacPrinter \value CoreGraphics \macos's Quartz2D (CoreGraphics) \value QuickDraw \macos's QuickDraw \value QWindowSystem Qt for Embedded Linux \value OpenGL \value Picture QPicture format \value SVG Scalable Vector Graphics XML format \value Raster \value Direct3D Windows only, Direct3D based engine \value Pdf Portable Document Format \value OpenVG \value User First user type ID \value MaxUser Last user type ID \value OpenGL2 \value PaintBuffer \value Blitter \value Direct2D Windows only, Direct2D based engine

Enumerator
X11 
Windows 
QuickDraw 
CoreGraphics 
MacPrinter 
QWindowSystem 
OpenGL 
Picture 
SVG 
Raster 
Direct3D 
Pdf 
OpenVG 
OpenGL2 
PaintBuffer 
Blitter 
Direct2D 
User 
MaxUser 

Definition at line 157 of file qpaintengine.h.

Constructor & Destructor Documentation

◆ QPaintEngine() [1/2]

QPaintEngine::QPaintEngine ( PaintEngineFeatures features = PaintEngineFeatures())
explicit

Creates a paint engine with the featureset specified by caps.

Definition at line 662 of file qpaintengine.cpp.

◆ ~QPaintEngine()

QPaintEngine::~QPaintEngine ( )
virtual

Destroys the paint engine.

Definition at line 691 of file qpaintengine.cpp.

◆ QPaintEngine() [2/2]

QPaintEngine::QPaintEngine ( QPaintEnginePrivate & dptr,
PaintEngineFeatures caps = PaintEngineFeatures() )
protected

Definition at line 677 of file qpaintengine.cpp.

Member Function Documentation

◆ begin()

virtual bool QPaintEngine::begin ( QPaintDevice * pdev)
pure virtual

Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev.

Return true if the initialization was successful; otherwise return false.

See also
end(), isActive()

Implemented in QAlphaPaintEngine, QBlitterPaintEngine, QCoreGraphicsPaintEngine, QEmulationPaintEngine, QMacPrintEngine, QOpenGL2PaintEngineEx, QPdfEngine, QPdfPrintEngine, QPicturePaintEngine, QPreviewPaintEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWin32PrintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

◆ clearDirty()

void QPaintEngine::clearDirty ( DirtyFlags df)
inline

Definition at line 295 of file qpaintengine.h.

◆ coordinateOffset()

QPoint QPaintEngine::coordinateOffset ( ) const
virtual

Returns the offset from the painters origo to the engines origo. This value is used by QPainter for engines who have internal double buffering.

This function only makes sense when the engine is active.

Reimplemented in QRasterPaintEngine.

Definition at line 902 of file qpaintengine.cpp.

◆ createPixmap()

QPixmap QPaintEngine::createPixmap ( QSize size)
virtual

Creates a QPixmap optimized for this paint engine and device.

Definition at line 972 of file qpaintengine.cpp.

◆ createPixmapFromImage()

QPixmap QPaintEngine::createPixmapFromImage ( QImage image,
Qt::ImageConversionFlags flags = Qt::AutoColor )
virtual

Creates a QPixmap optimized for this paint engine and device.

Definition at line 989 of file qpaintengine.cpp.

◆ drawEllipse() [1/2]

void QPaintEngine::drawEllipse ( const QRect & r)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation of this function calls the floating point version of this function.

Reimplemented in QCoreGraphicsPaintEngine, QPaintEngineEx, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

Definition at line 489 of file qpaintengine.cpp.

◆ drawEllipse() [2/2]

void QPaintEngine::drawEllipse ( const QRectF & rect)
virtual

Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.

The default implementation calls drawPolygon().

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPicturePaintEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

Definition at line 471 of file qpaintengine.cpp.

◆ drawImage()

void QPaintEngine::drawImage ( const QRectF & r,
const QImage & pm,
const QRectF & sr,
Qt::ImageConversionFlags flags = Qt::AutoColor )
virtual

Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap.

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QEmulationPaintEngine, QMacPrintEngine, QOpenGL2PaintEngineEx, QPaintEngineEx, QPdfEngine, QPicturePaintEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

Definition at line 586 of file qpaintengine.cpp.

◆ drawLines() [1/2]

void QPaintEngine::drawLines ( const QLine * lines,
int lineCount )
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function.

Reimplemented in QCoreGraphicsPaintEngine, QPaintEngineEx, QRasterPaintEngine, and QX11PaintEngine.

Definition at line 784 of file qpaintengine.cpp.

◆ drawLines() [2/2]

void QPaintEngine::drawLines ( const QLineF * lines,
int lineCount )
virtual

The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine.

Reimplemented in QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QRasterPaintEngine, and QX11PaintEngine.

Definition at line 762 of file qpaintengine.cpp.

◆ drawPath()

void QPaintEngine::drawPath ( const QPainterPath & path)
virtual

The default implementation ignores the path and does nothing.

Reimplemented in QAlphaPaintEngine, QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QPicturePaintEngine, QPreviewPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWin32PrintEngine, and QX11PaintEngine.

Definition at line 707 of file qpaintengine.cpp.

◆ drawPixmap()

virtual void QPaintEngine::drawPixmap ( const QRectF & r,
const QPixmap & pm,
const QRectF & sr )
pure virtual

◆ drawPoints() [1/2]

void QPaintEngine::drawPoints ( const QPoint * points,
int pointCount )
virtual

Draws the first pointCount points in the buffer points.

The default implementation converts the first pointCount QPoints in points to QPointFs and calls the floating point version of drawPoints.

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QPaintEngineEx, QRasterPaintEngine, and QX11PaintEngine.

Definition at line 446 of file qpaintengine.cpp.

◆ drawPoints() [2/2]

void QPaintEngine::drawPoints ( const QPointF * points,
int pointCount )
virtual

Draws the first pointCount points in the buffer points.

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QRasterPaintEngine, and QX11PaintEngine.

Definition at line 402 of file qpaintengine.cpp.

◆ drawPolygon() [1/2]

void QPaintEngine::drawPolygon ( const QPoint * points,
int pointCount,
PolygonDrawMode mode )
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note
At least one of the drawPolygon() functions must be reimplemented.

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QPaintEngineEx, QPicturePaintEngine, QRasterPaintEngine, and QX11PaintEngine.

Definition at line 322 of file qpaintengine.cpp.

◆ drawPolygon() [2/2]

void QPaintEngine::drawPolygon ( const QPointF * points,
int pointCount,
PolygonDrawMode mode )
virtual

Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note
At least one of the drawPolygon() functions must be reimplemented.

Reimplemented in QAlphaPaintEngine, QBlitterPaintEngine, QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QPicturePaintEngine, QPreviewPaintEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWin32PrintEngine, and QX11PaintEngine.

Definition at line 293 of file qpaintengine.cpp.

◆ drawRects() [1/2]

void QPaintEngine::drawRects ( const QRect * rects,
int rectCount )
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function.

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QPaintEngineEx, QRasterPaintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

Definition at line 820 of file qpaintengine.cpp.

◆ drawRects() [2/2]

void QPaintEngine::drawRects ( const QRectF * rects,
int rectCount )
virtual

Draws the first rectCount rectangles in the buffer rects.

The default implementation of this function calls drawPath() or drawPolygon() depending on the feature set of the paint engine.

Reimplemented in QBlitterPaintEngine, QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

Definition at line 850 of file qpaintengine.cpp.

◆ drawTextItem()

void QPaintEngine::drawTextItem ( const QPointF & p,
const QTextItem & textItem )
virtual

This function draws the text item textItem at position p.

The default implementation of this function converts the text to a QPainterPath and paints the resulting path.

Reimplemented in QAlphaPaintEngine, QBlitterPaintEngine, QCoreGraphicsPaintEngine, QEmulationPaintEngine, QMacPrintEngine, QOpenGL2PaintEngineEx, QPdfEngine, QPicturePaintEngine, QPreviewPaintEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWin32PrintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

Definition at line 720 of file qpaintengine.cpp.

◆ drawTiledPixmap()

void QPaintEngine::drawTiledPixmap ( const QRectF & rect,
const QPixmap & pixmap,
const QPointF & p )
virtual

Reimplement this function to draw the pixmap in the given rect, starting at the given p.

The pixmap will be drawn repeatedly until the rect is filled.

Reimplemented in QAlphaPaintEngine, QBlitterPaintEngine, QCoreGraphicsPaintEngine, QEmulationPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QPicturePaintEngine, QPreviewPaintEngine, QRasterPaintEngine, QWin32PrintEngine, and QX11PaintEngine.

Definition at line 551 of file qpaintengine.cpp.

◆ end()

virtual bool QPaintEngine::end ( )
pure virtual

Reimplement this function to finish painting on the current paint device.

Return true if painting was finished successfully; otherwise return false.

See also
begin(), isActive()

Implemented in QAlphaPaintEngine, QBlitterPaintEngine, QCoreGraphicsPaintEngine, QEmulationPaintEngine, QMacPrintEngine, QOpenGL2PaintEngineEx, QPdfEngine, QPdfPrintEngine, QPicturePaintEngine, QPreviewPaintEngine, QRasterPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWin32PrintEngine, QWindowsDirect2DPaintEngine, and QX11PaintEngine.

◆ fix_neg_rect()

void QPaintEngine::fix_neg_rect ( int * x,
int * y,
int * w,
int * h )
inline

Definition at line 273 of file qpaintengine.h.

◆ hasFeature()

bool QPaintEngine::hasFeature ( PaintEngineFeatures feature) const
inline

Returns true if the paint engine supports the specified feature; otherwise returns false.

Definition at line 185 of file qpaintengine.h.

◆ isActive()

bool QPaintEngine::isActive ( ) const
inline

Returns true if the paint engine is actively drawing; otherwise returns false.

See also
setActive()

Definition at line 114 of file qpaintengine.h.

◆ isExtended()

bool QPaintEngine::isExtended ( ) const
inline

Returns true if the paint engine is a QPaintEngineEx derivative.

Definition at line 190 of file qpaintengine.h.

◆ paintDevice()

QPaintDevice * QPaintEngine::paintDevice ( ) const

Returns the device that this engine is painting on, if painting is active; otherwise returns \nullptr.

Definition at line 887 of file qpaintengine.cpp.

◆ painter()

QPainter * QPaintEngine::painter ( ) const

Returns the paint engine's painter.

Definition at line 698 of file qpaintengine.cpp.

◆ setActive()

void QPaintEngine::setActive ( bool state)
inline

Sets the active state of the paint engine to state.

See also
isActive()

Definition at line 115 of file qpaintengine.h.

◆ setDirty()

void QPaintEngine::setDirty ( DirtyFlags df)
inline

Definition at line 290 of file qpaintengine.h.

◆ setPaintDevice()

void QPaintEngine::setPaintDevice ( QPaintDevice * device)

Sets the paintdevice that this engine operates on to device

Definition at line 878 of file qpaintengine.cpp.

◆ setSystemClip()

void QPaintEngine::setSystemClip ( const QRegion & region)

Sets the system clip for this engine. The system clip defines the basis area that the engine has to draw in. All clips that are set will be an intersection with the system clip.

Reset the systemclip to no clip by setting an empty region.

Definition at line 916 of file qpaintengine.cpp.

◆ setSystemRect()

void QPaintEngine::setSystemRect ( const QRect & rect)

Sets the target rect for drawing within the backing store. This function should ONLY be used by the backing store.

Definition at line 947 of file qpaintengine.cpp.

◆ syncState()

void QPaintEngine::syncState ( )

Updates all dirty states in this engine. This function should ONLY be used when drawing with native handles directly and immediate sync from QPainters state to the native state is required.

Definition at line 267 of file qpaintengine.cpp.

◆ systemClip()

QRegion QPaintEngine::systemClip ( ) const

Returns the system clip. The system clip is read only while the painter is active. An empty region indicates that system clip is not in use.

Definition at line 936 of file qpaintengine.cpp.

◆ systemRect()

QRect QPaintEngine::systemRect ( ) const

Retrieves the rect for drawing within the backing store. This function should ONLY be used by the backing store.

Definition at line 962 of file qpaintengine.cpp.

◆ testDirty()

bool QPaintEngine::testDirty ( DirtyFlags df)
inline

Definition at line 285 of file qpaintengine.h.

◆ type()

◆ updateState()

virtual void QPaintEngine::updateState ( const QPaintEngineState & state)
pure virtual

Reimplement this function to update the state of a paint engine.

When implemented, this function is responsible for checking the paint engine's current state and update the properties that are changed. Use the QPaintEngineState::state() function to find out which properties that must be updated, then use the corresponding \l {GetFunction}{get function} to retrieve the current values for the given properties.

See also
QPaintEngineState

Implemented in QAlphaPaintEngine, QCoreGraphicsPaintEngine, QMacPrintEngine, QPaintEngineEx, QPdfEngine, QPicturePaintEngine, QPreviewPaintEngine, QSvgPaintEngine, QSvgPaintEngine, QWin32PrintEngine, and QX11PaintEngine.

Friends And Related Symbol Documentation

◆ QFontEngineBox

friend class QFontEngineBox
friend

Definition at line 213 of file qpaintengine.h.

◆ QFontEngineMac

friend class QFontEngineMac
friend

Definition at line 214 of file qpaintengine.h.

◆ QFontEngineQPF2

friend class QFontEngineQPF2
friend

Definition at line 218 of file qpaintengine.h.

◆ QFontEngineWin

friend class QFontEngineWin
friend

Definition at line 215 of file qpaintengine.h.

◆ QMacCGContext

friend class QMacCGContext
friend

Definition at line 225 of file qpaintengine.h.

◆ QMacPrintEngine

friend class QMacPrintEngine
friend

Definition at line 216 of file qpaintengine.h.

◆ QMacPrintEnginePrivate

friend class QMacPrintEnginePrivate
friend

Definition at line 217 of file qpaintengine.h.

◆ QPainter

◆ QPainterPrivate

friend class QPainterPrivate
friend

Definition at line 220 of file qpaintengine.h.

◆ QPainterReplayer

friend class QPainterReplayer
friend

Definition at line 212 of file qpaintengine.h.

◆ QPreviewPaintEngine

friend class QPreviewPaintEngine
friend

Definition at line 226 of file qpaintengine.h.

◆ QWidget

friend class QWidget
friend

Definition at line 221 of file qpaintengine.h.

◆ QWidgetPrivate

friend class QWidgetPrivate
friend

Definition at line 222 of file qpaintengine.h.

Referenced by qSendWindowChangeToTextureChildrenRecursively().

◆ QWin32PaintEngine

friend class QWin32PaintEngine
friend

Definition at line 223 of file qpaintengine.h.

◆ QWin32PaintEnginePrivate

friend class QWin32PaintEnginePrivate
friend

Definition at line 224 of file qpaintengine.h.

◆ QX11GLPlatformPixmap

friend class QX11GLPlatformPixmap
friend

Definition at line 227 of file qpaintengine.h.

Member Data Documentation

◆ active

uint QPaintEngine::active
protected

Definition at line 201 of file qpaintengine.h.

◆ d_ptr

QScopedPointer<QPaintEnginePrivate> QPaintEngine::d_ptr
protected

Definition at line 205 of file qpaintengine.h.

◆ extended

uint QPaintEngine::extended
protected

Definition at line 203 of file qpaintengine.h.

◆ gccaps

PaintEngineFeatures QPaintEngine::gccaps
protected

Definition at line 199 of file qpaintengine.h.

◆ selfDestruct

uint QPaintEngine::selfDestruct
protected

Definition at line 202 of file qpaintengine.h.

◆ state

QPaintEngineState* QPaintEngine::state
protected

Definition at line 198 of file qpaintengine.h.


The documentation for this class was generated from the following files: