Qt 4.8
Public Functions | Protected Variables | Friends | List of all members
QPaintEngineState Class Reference

The QPaintEngineState class provides information about the active paint engine's current state. More...

#include <qpaintengine.h>

Inheritance diagram for QPaintEngineState:
QPainterState QOpenGL2PaintEngineState QOpenGLPaintEngineState QRasterPaintEngineState QVGPainterState

Public Functions

QBrush backgroundBrush () const
 Returns the background brush in the current paint engine state. More...
 
Qt::BGMode backgroundMode () const
 Returns the background mode in the current paint engine state. More...
 
QBrush brush () const
 Returns the brush in the current paint engine state. More...
 
bool brushNeedsResolving () const
 Returns whether the coordinate of the fill have been specified as bounded by the current rendering operation and have to be resolved (about the currently rendered primitive). More...
 
QPointF brushOrigin () const
 Returns the brush origin in the current paint engine state. More...
 
Qt::ClipOperation clipOperation () const
 Returns the clip operation in the current paint engine state. More...
 
QPainterPath clipPath () const
 Returns the clip path in the current paint engine state. More...
 
QRegion clipRegion () const
 Returns the clip region in the current paint engine state. More...
 
QPainter::CompositionMode compositionMode () const
 Returns the composition mode in the current paint engine state. More...
 
QFont font () const
 Returns the font in the current paint engine state. More...
 
bool isClipEnabled () const
 Returns whether clipping is enabled or not in the current paint engine state. More...
 
QMatrix matrix () const
 Returns the matrix in the current paint engine state. More...
 
qreal opacity () const
 Returns the opacity in the current paint engine state. More...
 
QPainterpainter () const
 Returns a pointer to the painter currently updating the paint engine. More...
 
QPen pen () const
 Returns the pen in the current paint engine state. More...
 
bool penNeedsResolving () const
 Returns whether the coordinate of the stroke have been specified as bounded by the current rendering operation and have to be resolved (about the currently rendered primitive). More...
 
QPainter::RenderHints renderHints () const
 Returns the render hints in the current paint engine state. More...
 
QPaintEngine::DirtyFlags state () const
 Returns a combination of flags identifying the set of properties that need to be updated when updating the paint engine's state (i. More...
 
QTransform transform () const
 Returns the matrix in the current paint engine state. More...
 

Protected Variables

QPaintEngine::DirtyFlags dirtyFlags
 

Friends

class QMacPrintEnginePrivate
 
class QPaintEngine
 
class QPainter
 
class QPainterPrivate
 
class QRasterPaintEngine
 
class QWidget
 

Detailed Description

The QPaintEngineState class provides information about the active paint engine's current state.

Since
4.1
Note
This class or function is reentrant.

QPaintEngineState records which properties that have changed since the last time the paint engine was updated, as well as their current value.

Which properties that have changed can at any time be retrieved using the state() function. This function returns an instance of the QPaintEngine::DirtyFlags type which stores an OR combination of QPaintEngine::DirtyFlag values. The QPaintEngine::DirtyFlag enum defines whether a property has changed since the last update or not.

If a property is marked with a dirty flag, its current value can be retrieved using the corresponding get function:

Property Flag Current Property Value
QPaintEngine::DirtyBackground backgroundBrush()
QPaintEngine::DirtyBackgroundMode backgroundMode()
QPaintEngine::DirtyBrush brush()
QPaintEngine::DirtyBrushOrigin brushOrigin()
QPaintEngine::DirtyClipRegion or QPaintEngine::DirtyClipPath clipOperation()
QPaintEngine::DirtyClipPath clipPath()
QPaintEngine::DirtyClipRegion clipRegion()
QPaintEngine::DirtyCompositionMode compositionMode()
QPaintEngine::DirtyFont font()
QPaintEngine::DirtyTransform transform()
QPaintEngine::DirtyClipEnabled isClipEnabled()
QPaintEngine::DirtyPen pen()
QPaintEngine::DirtyHints renderHints()

The QPaintEngineState class also provide the painter() function which returns a pointer to the painter that is currently updating the paint engine.

An instance of this class, representing the current state of the active paint engine, is passed as argument to the QPaintEngine::updateState() function. The only situation in which you will have to use this class directly is when implementing your own paint engine.

See also
QPaintEngine

Definition at line 289 of file qpaintengine.h.

Functions

◆ backgroundBrush()

QBrush QPaintEngineState::backgroundBrush ( ) const

Returns the background brush in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyBackground flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9301 of file qpainter.cpp.

Referenced by QPicturePaintEngine::updateState().

9302 {
9303  return static_cast<const QPainterState *>(this)->bgBrush;
9304 }

◆ backgroundMode()

Qt::BGMode QPaintEngineState::backgroundMode ( ) const

Returns the background mode in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyBackgroundMode flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9316 of file qpainter.cpp.

Referenced by QPicturePaintEngine::updateState().

9317 {
9318  return static_cast<const QPainterState *>(this)->bgMode;
9319 }

◆ brush()

QBrush QPaintEngineState::brush ( ) const

◆ brushNeedsResolving()

bool QPaintEngineState::brushNeedsResolving ( ) const

Returns whether the coordinate of the fill have been specified as bounded by the current rendering operation and have to be resolved (about the currently rendered primitive).

Since
4.3

Definition at line 9411 of file qpainter.cpp.

Referenced by QPaintEngine::drawRects().

9412 {
9413  const QBrush &brush = static_cast<const QPainterState *>(this)->brush;
9414  return needsResolving(brush);
9415 }
QBrush brush() const
Returns the brush in the current paint engine state.
Definition: qpainter.cpp:9273
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
static bool needsResolving(const QBrush &brush)
Definition: qpainter.cpp:7339

◆ brushOrigin()

QPointF QPaintEngineState::brushOrigin ( ) const

Returns the brush origin in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyBrushOrigin flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9287 of file qpainter.cpp.

Referenced by QPainterState::init(), QPicturePaintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), and QPdfBaseEngine::updateState().

9288 {
9289  return static_cast<const QPainterState *>(this)->brushOrigin;
9290 }
QPointF brushOrigin() const
Returns the brush origin in the current paint engine state.
Definition: qpainter.cpp:9287

◆ clipOperation()

Qt::ClipOperation QPaintEngineState::clipOperation ( ) const

Returns the clip operation in the current paint engine state.

This variable should only be used when the state() returns a combination which includes either the QPaintEngine::DirtyClipPath or the QPaintEngine::DirtyClipRegion flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9396 of file qpainter.cpp.

Referenced by QPainterState::init(), QPicturePaintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QWin32PrintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), and QPdfBaseEngine::updateState().

9397 {
9398  return static_cast<const QPainterState *>(this)->clipOperation;
9399 }
Qt::ClipOperation clipOperation() const
Returns the clip operation in the current paint engine state.
Definition: qpainter.cpp:9396

◆ clipPath()

QPainterPath QPaintEngineState::clipPath ( ) const

Returns the clip path in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyClipPath flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9457 of file qpainter.cpp.

Referenced by QPainterState::init(), QPicturePaintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QWin32PrintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), and QPdfBaseEngine::updateState().

9458 {
9459  return static_cast<const QPainterState *>(this)->clipPath;
9460 }
QPainterPath clipPath() const
Returns the clip path in the current paint engine state.
Definition: qpainter.cpp:9457

◆ clipRegion()

QRegion QPaintEngineState::clipRegion ( ) const

Returns the clip region in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyClipRegion flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9443 of file qpainter.cpp.

Referenced by QPainterState::init(), QClipData::initialize(), QOpenGLPaintEngineState::QOpenGLPaintEngineState(), QRasterPaintEngine::setClipRectInDeviceCoords(), QClipData::setClipRegion(), QPicturePaintEngine::updateState(), QWin32PrintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), and QPdfBaseEngine::updateState().

9444 {
9445  return static_cast<const QPainterState *>(this)->clipRegion;
9446 }
QRegion clipRegion() const
Returns the clip region in the current paint engine state.
Definition: qpainter.cpp:9443

◆ compositionMode()

QPainter::CompositionMode QPaintEngineState::compositionMode ( ) const

◆ font()

QFont QPaintEngineState::font ( ) const

Returns the font in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyFont flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9331 of file qpainter.cpp.

Referenced by QPainterState::init(), QOpenGLPaintEngine::state(), QPicturePaintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), and QSvgPaintEngine::updateState().

9332 {
9333  return static_cast<const QPainterState *>(this)->font;
9334 }
QFont font() const
Returns the font in the current paint engine state.
Definition: qpainter.cpp:9331

◆ isClipEnabled()

bool QPaintEngineState::isClipEnabled ( ) const

Returns whether clipping is enabled or not in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyClipEnabled flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9473 of file qpainter.cpp.

Referenced by QPicturePaintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QWin32PrintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), and QPdfBaseEngine::updateState().

9474 {
9475  return static_cast<const QPainterState *>(this)->clipEnabled;
9476 }

◆ matrix()

QMatrix QPaintEngineState::matrix ( ) const

Returns the matrix in the current paint engine state.

Since
4.2
Note
It is advisable to use transform() instead of this function to preserve the properties of perspective transformations.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyTransform flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9355 of file qpainter.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), QRasterPaintEngine::drawTextItem(), QPainterState::init(), QSpanData::setupMatrix(), QPainter::setWorldTransform(), QOpenGLPaintEngine::state(), QRasterPaintEngine::state(), QRasterPaintEngine::updateOutlineMapper(), and QSvgPaintEngine::updateState().

9356 {
9357  const QPainterState *st = static_cast<const QPainterState *>(this);
9358 
9359  return st->matrix.toAffine();
9360 }
QTransform matrix
Definition: qpainter_p.h:161
const QMatrix & toAffine() const
Returns the QTransform as an affine matrix.
#define st(var, type, card)

◆ opacity()

qreal QPaintEngineState::opacity ( ) const

◆ painter()

QPainter * QPaintEngineState::painter ( ) const

Returns a pointer to the painter currently updating the paint engine.

Definition at line 9514 of file qpainter.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), QPainterState::init(), QPaintEngine::painter(), and QPainterPrivate::updateStateImpl().

9515 {
9516  return static_cast<const QPainterState *>(this)->painter;
9517 }
QPainter * painter() const
Returns a pointer to the painter currently updating the paint engine.
Definition: qpainter.cpp:9514

◆ pen()

QPen QPaintEngineState::pen ( ) const

◆ penNeedsResolving()

bool QPaintEngineState::penNeedsResolving ( ) const

Returns whether the coordinate of the stroke have been specified as bounded by the current rendering operation and have to be resolved (about the currently rendered primitive).

Since
4.3

Definition at line 9428 of file qpainter.cpp.

Referenced by QPaintEngine::drawRects().

9429 {
9430  const QPen &pen = static_cast<const QPainterState *>(this)->pen;
9431  return needsResolving(pen.brush());
9432 }
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
QPen pen() const
Returns the pen in the current paint engine state.
Definition: qpainter.cpp:9259
static bool needsResolving(const QBrush &brush)
Definition: qpainter.cpp:7339

◆ renderHints()

QPainter::RenderHints QPaintEngineState::renderHints ( ) const

Returns the render hints in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the QPaintEngine::DirtyHints flag.

See also
state(), QPaintEngine::updateState()

Definition at line 9488 of file qpainter.cpp.

Referenced by QCoreGraphicsPaintEngine::drawPoints(), QCoreGraphicsPaintEngine::drawTextItem(), QPainterState::init(), QPicturePaintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QX11PaintEngine::updateState(), and QOpenGLPaintEngine::updateState().

9489 {
9490  return static_cast<const QPainterState *>(this)->renderHints;
9491 }
QPainter::RenderHints renderHints() const
Returns the render hints in the current paint engine state.
Definition: qpainter.cpp:9488

◆ state()

QPaintEngine::DirtyFlags QPaintEngineState::state ( ) const
inline

Returns a combination of flags identifying the set of properties that need to be updated when updating the paint engine's state (i.

e. during a call to the QPaintEngine::updateState() function).

\sa QPaintEngine::updateState()

Definition at line 292 of file qpaintengine.h.

Referenced by QRasterPaintEngine::alphaPenBlt(), QRasterPaintEngine::brushChanged(), QRasterPaintEnginePrivate::brushMatrix(), QRasterPaintEngine::brushOriginChanged(), QRasterPaintEnginePrivate::canUseFastImageBlending(), QRasterPaintEngine::clip(), QRasterPaintEngine::clipEnabledChanged(), QRasterPaintEngine::compositionModeChanged(), QGL2PaintEngineExPrivate::drawCachedGlyphs(), QRasterPaintEngine::drawCachedGlyphs(), QRasterPaintEngine::drawEllipse(), QRasterPaintEngine::drawImage(), QRasterPaintEngine::drawLines(), QRasterPaintEngine::drawPixmap(), QRasterPaintEngine::drawPoints(), QRasterPaintEngine::drawPolygon(), QRasterPaintEngine::drawRects(), QRasterPaintEngine::drawTextItem(), QRasterPaintEngine::drawTiledPixmap(), QRasterPaintEngine::ensureBrush(), QRasterPaintEngine::ensurePen(), QRasterPaintEngine::ensureState(), QRasterPaintEngine::fill(), QRasterPaintEngine::fillPath(), QRasterPaintEngine::fillPolygon(), QRasterPaintEngine::fillRect(), QStaticTextPrivate::get(), QRasterPaintEnginePrivate::getPenFunc(), QRasterPaintEnginePrivate::initializeRasterizer(), QRasterPaintEnginePrivate::isUnclipped(), QRasterPaintEngine::opacityChanged(), QRasterPaintEngine::penChanged(), QRasterPaintEnginePrivate::rasterize(), QRasterPaintEnginePrivate::rasterizeLine_dashed(), QRasterPaintEnginePrivate::recalculateFastImages(), QRasterPaintEngine::renderHintsChanged(), QRasterPaintEngine::setClipRectInDeviceCoords(), QOpenGLPaintEngine::state(), QRasterPaintEngine::stroke(), QGL2PaintEngineExPrivate::stroke(), QRasterPaintEngine::supportsTransformations(), QRasterPaintEngine::transformChanged(), QRasterPaintEngine::updateBrush(), QPainterPrivate::updateEmulationSpecifier(), QRasterPaintEngine::updateOutlineMapper(), QRasterPaintEngine::updatePen(), QAlphaPaintEngine::updateState(), QPicturePaintEngine::updateState(), QWin32PrintEngine::updateState(), QCoreGraphicsPaintEngine::updateState(), QX11PaintEngine::updateState(), QOpenGLPaintEngine::updateState(), QSvgPaintEngine::updateState(), QPdfBaseEngine::updateState(), QPainterPrivate::updateState(), and QRasterPaintEngine::updateState().

292 { return dirtyFlags; }
QPaintEngine::DirtyFlags dirtyFlags
Definition: qpaintengine.h:325

◆ transform()

QTransform QPaintEngineState::transform ( ) const

Friends and Related Functions

◆ QMacPrintEnginePrivate

Definition at line 323 of file qpaintengine.h.

◆ QPaintEngine

friend class QPaintEngine
friend

Definition at line 318 of file qpaintengine.h.

◆ QPainter

friend class QPainter
friend

Definition at line 321 of file qpaintengine.h.

◆ QPainterPrivate

friend class QPainterPrivate
friend

Definition at line 322 of file qpaintengine.h.

◆ QRasterPaintEngine

friend class QRasterPaintEngine
friend

Definition at line 319 of file qpaintengine.h.

Referenced by QRasterPaintEngine::type().

◆ QWidget

friend class QWidget
friend

Definition at line 320 of file qpaintengine.h.

Properties

◆ dirtyFlags

QPaintEngine::DirtyFlags QPaintEngineState::dirtyFlags
protected

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