Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QEmulationPaintEngine Class Reference

#include <qemulationpaintengine_p.h>

+ Inheritance diagram for QEmulationPaintEngine:
+ Collaboration diagram for QEmulationPaintEngine:

Public Member Functions

 QEmulationPaintEngine (QPaintEngineEx *engine)
 
bool begin (QPaintDevice *pdev) override
 Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev.
 
bool end () override
 Reimplement this function to finish painting on the current paint device.
 
Type type () const override
 Reimplement this function to return the paint engine \l{Type}.
 
QPainterStatecreateState (QPainterState *orig) const override
 
void fill (const QVectorPath &path, const QBrush &brush) override
 
void stroke (const QVectorPath &path, const QPen &pen) override
 
void clip (const QVectorPath &path, Qt::ClipOperation op) override
 
void drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr) override
 Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
 
void drawTextItem (const QPointF &p, const QTextItem &textItem) override
 This function draws the text item textItem at position p.
 
void drawStaticTextItem (QStaticTextItem *item) override
 
void drawTiledPixmap (const QRectF &r, const QPixmap &pixmap, const QPointF &s) override
 Reimplement this function to draw the pixmap in the given rect, starting at the given p.
 
void drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags) override
 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 clipEnabledChanged () override
 
void penChanged () override
 
void brushChanged () override
 
void brushOriginChanged () override
 
void opacityChanged () override
 
void compositionModeChanged () override
 
void renderHintsChanged () override
 
void transformChanged () override
 
void setState (QPainterState *s) override
 
void beginNativePainting () override
 
void endNativePainting () override
 
uint flags () const override
 
QPainterStatestate ()
 
const QPainterStatestate () const
 
- Public Member Functions inherited from QPaintEngineEx
 QPaintEngineEx ()
 
virtual void draw (const QVectorPath &path)
 
virtual void clip (const QRect &rect, Qt::ClipOperation op)
 
virtual void clip (const QRegion &region, Qt::ClipOperation op)
 
virtual void clip (const QPainterPath &path, Qt::ClipOperation op)
 
virtual void fillRect (const QRectF &rect, const QBrush &brush)
 
virtual void fillRect (const QRectF &rect, const QColor &color)
 
virtual void drawRoundedRect (const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode)
 
virtual void drawRects (const QRect *rects, int rectCount) override
 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) override
 Draws the first rectCount rectangles in the buffer rects.
 
virtual void drawLines (const QLine *lines, int lineCount) override
 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) override
 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) override
 Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
 
virtual void drawEllipse (const QRect &r) override
 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) override
 The default implementation ignores the path and does nothing.
 
virtual void drawPoints (const QPointF *points, int pointCount) override
 Draws the first pointCount points in the buffer points.
 
virtual void drawPoints (const QPoint *points, int pointCount) override
 Draws the first pointCount points in the buffer points.
 
virtual void drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode) override
 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) override
 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 QPointF &pos, const QPixmap &pm)
 
virtual void drawImage (const QPointF &pos, const QImage &image)
 
virtual void drawPixmapFragments (const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QFlags< QPainter::PixmapFragmentHint > hints)
 
virtual void updateState (const QPaintEngineState &state) override
 Reimplement this function to update the state of a paint engine.
 
QPainterStatestate ()
 
const QPainterStatestate () const
 
virtual void sync ()
 
virtual bool requiresPretransformedGlyphPositions (QFontEngine *fontEngine, const QTransform &m) const
 
virtual bool shouldDrawCachedGlyphs (QFontEngine *fontEngine, const QTransform &m) const
 
- Public Member Functions inherited from QPaintEngine
 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.
 
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
 
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)
 

Public Attributes

QPaintEngineExreal_engine
 

Additional Inherited Members

- Public Types inherited from QPaintEngineEx
enum  Flags { DoNotEmulate = 0x01 , IsEmulationEngine = 0x02 }
 
- Public Types inherited from QPaintEngine
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...
 
- Protected Member Functions inherited from QPaintEngineEx
 QPaintEngineEx (QPaintEngineExPrivate &data)
 
- Protected Member Functions inherited from QPaintEngine
 QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures())
 
- Protected Attributes inherited from QPaintEngine
QPaintEngineStatestate
 
PaintEngineFeatures gccaps
 
uint active: 1
 
uint selfDestruct: 1
 
uint extended: 1
 
QScopedPointer< QPaintEnginePrivated_ptr
 

Detailed Description

Definition at line 24 of file qemulationpaintengine_p.h.

Constructor & Destructor Documentation

◆ QEmulationPaintEngine()

QT_BEGIN_NAMESPACE QEmulationPaintEngine::QEmulationPaintEngine ( QPaintEngineEx * engine)

Definition at line 11 of file qemulationpaintengine.cpp.

References real_engine, QPaintEngine::state, and QPaintEngineEx::state().

+ Here is the call graph for this function:

Member Function Documentation

◆ begin()

bool QEmulationPaintEngine::begin ( QPaintDevice * pdev)
overridevirtual

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()

Implements QPaintEngine.

Definition at line 23 of file qemulationpaintengine.cpp.

◆ beginNativePainting()

void QEmulationPaintEngine::beginNativePainting ( )
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 224 of file qemulationpaintengine.cpp.

References QPaintEngineEx::beginNativePainting(), and real_engine.

+ Here is the call graph for this function:

◆ brushChanged()

void QEmulationPaintEngine::brushChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 188 of file qemulationpaintengine.cpp.

References QPaintEngineEx::brushChanged(), and real_engine.

+ Here is the call graph for this function:

◆ brushOriginChanged()

void QEmulationPaintEngine::brushOriginChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 193 of file qemulationpaintengine.cpp.

References QPaintEngineEx::brushOriginChanged(), and real_engine.

+ Here is the call graph for this function:

◆ clip()

void QEmulationPaintEngine::clip ( const QVectorPath & path,
Qt::ClipOperation op )
overridevirtual

Implements QPaintEngineEx.

Definition at line 111 of file qemulationpaintengine.cpp.

References QPaintEngineEx::clip(), and real_engine.

+ Here is the call graph for this function:

◆ clipEnabledChanged()

void QEmulationPaintEngine::clipEnabledChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 178 of file qemulationpaintengine.cpp.

References QPaintEngineEx::clipEnabledChanged(), and real_engine.

+ Here is the call graph for this function:

◆ compositionModeChanged()

void QEmulationPaintEngine::compositionModeChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 203 of file qemulationpaintengine.cpp.

References QPaintEngineEx::compositionModeChanged(), and real_engine.

+ Here is the call graph for this function:

◆ createState()

QPainterState * QEmulationPaintEngine::createState ( QPainterState * orig) const
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 34 of file qemulationpaintengine.cpp.

References QPaintEngineEx::createState(), and real_engine.

+ Here is the call graph for this function:

◆ drawImage()

void QEmulationPaintEngine::drawImage ( const QRectF & r,
const QImage & pm,
const QRectF & sr,
Qt::ImageConversionFlags flags )
overridevirtual

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.

Implements QPaintEngineEx.

Definition at line 173 of file qemulationpaintengine.cpp.

References QPaintEngineEx::drawImage(), and real_engine.

+ Here is the call graph for this function:

◆ drawPixmap()

void QEmulationPaintEngine::drawPixmap ( const QRectF & r,
const QPixmap & pm,
const QRectF & sr )
overridevirtual

Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.

Implements QPaintEngineEx.

Definition at line 116 of file qemulationpaintengine.cpp.

References QPaintEngineEx::drawPixmap(), QPixmap::isQBitmap(), Qt::OpaqueMode, real_engine, and state().

+ Here is the call graph for this function:

◆ drawStaticTextItem()

void QEmulationPaintEngine::drawStaticTextItem ( QStaticTextItem * item)
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 161 of file qemulationpaintengine.cpp.

References QPaintEngineEx::drawStaticTextItem(), item, and real_engine.

+ Here is the call graph for this function:

◆ drawTextItem()

void QEmulationPaintEngine::drawTextItem ( const QPointF & p,
const QTextItem & textItem )
overridevirtual

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 from QPaintEngine.

Definition at line 123 of file qemulationpaintengine.cpp.

References combineXForm(), Qt::ConicalGradientPattern, copy(), d, QPainter::device(), QPaintEngine::drawTextItem(), Qt::LinearGradientPattern, QGradient::LogicalMode, Qt::OpaqueMode, QPaintEngine::painter(), penChanged(), qbrush_style(), real_engine, rect, state(), and QGradient::StretchToDeviceMode.

+ Here is the call graph for this function:

◆ drawTiledPixmap()

void QEmulationPaintEngine::drawTiledPixmap ( const QRectF & rect,
const QPixmap & pixmap,
const QPointF & p )
overridevirtual

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 from QPaintEngineEx.

Definition at line 166 of file qemulationpaintengine.cpp.

References QPaintEngineEx::drawTiledPixmap(), Qt::OpaqueMode, pixmap, real_engine, and state().

+ Here is the call graph for this function:

◆ end()

bool QEmulationPaintEngine::end ( )
overridevirtual

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()

Implements QPaintEngine.

Definition at line 28 of file qemulationpaintengine.cpp.

◆ endNativePainting()

void QEmulationPaintEngine::endNativePainting ( )
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 229 of file qemulationpaintengine.cpp.

References QPaintEngineEx::endNativePainting(), and real_engine.

+ Here is the call graph for this function:

◆ fill()

void QEmulationPaintEngine::fill ( const QVectorPath & path,
const QBrush & brush )
overridevirtual

◆ flags()

uint QEmulationPaintEngine::flags ( ) const
inlineoverridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 59 of file qemulationpaintengine_p.h.

References QPaintEngineEx::DoNotEmulate, and QPaintEngineEx::IsEmulationEngine.

◆ opacityChanged()

void QEmulationPaintEngine::opacityChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 198 of file qemulationpaintengine.cpp.

References QPaintEngineEx::opacityChanged(), and real_engine.

+ Here is the call graph for this function:

◆ penChanged()

void QEmulationPaintEngine::penChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 183 of file qemulationpaintengine.cpp.

References QPaintEngineEx::penChanged(), and real_engine.

Referenced by drawTextItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHintsChanged()

void QEmulationPaintEngine::renderHintsChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 208 of file qemulationpaintengine.cpp.

References real_engine, and QPaintEngineEx::renderHintsChanged().

+ Here is the call graph for this function:

◆ setState()

void QEmulationPaintEngine::setState ( QPainterState * s)
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 218 of file qemulationpaintengine.cpp.

References real_engine, QPaintEngineEx::setState(), and QPaintEngine::state.

+ Here is the call graph for this function:

◆ state() [1/2]

QPainterState * QEmulationPaintEngine::state ( )
inline

Definition at line 61 of file qemulationpaintengine_p.h.

References QPaintEngine::state.

Referenced by drawPixmap(), drawTextItem(), drawTiledPixmap(), fill(), and stroke().

+ Here is the caller graph for this function:

◆ state() [2/2]

const QPainterState * QEmulationPaintEngine::state ( ) const
inline

Definition at line 62 of file qemulationpaintengine_p.h.

References QPaintEngine::state.

◆ stroke()

void QEmulationPaintEngine::stroke ( const QVectorPath & path,
const QPen & pen )
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 82 of file qemulationpaintengine.cpp.

References QPen::brush(), combineXForm(), Qt::ConicalGradientPattern, copy(), d, QPainter::device(), Qt::LinearGradientPattern, QGradient::LogicalMode, Qt::OpaqueMode, QPaintEngine::painter(), qbrush_style(), real_engine, QPen::setBrush(), Qt::SolidLine, state(), QGradient::StretchToDeviceMode, QPaintEngineEx::stroke(), and QPen::style().

+ Here is the call graph for this function:

◆ transformChanged()

void QEmulationPaintEngine::transformChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 213 of file qemulationpaintengine.cpp.

References real_engine, and QPaintEngineEx::transformChanged().

+ Here is the call graph for this function:

◆ type()

QPaintEngine::Type QEmulationPaintEngine::type ( ) const
overridevirtual

Reimplement this function to return the paint engine \l{Type}.

Implements QPaintEngine.

Definition at line 18 of file qemulationpaintengine.cpp.

References real_engine, and QPaintEngine::type().

+ Here is the call graph for this function:

Member Data Documentation

◆ real_engine


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