QPaintEngineState Class Reference

#include <qpaintengine.h>

Inheritance diagram for QPaintEngineState:

Inheritance graph
[legend]
List of all members.

Detailed Description

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

Since:
4.1
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:

GetFunction

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 matrix() 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 245 of file qpaintengine.h.

Public Member Functions

QPaintEngine::DirtyFlags state () const
QPen pen () const
QBrush brush () const
QPointF brushOrigin () const
QBrush backgroundBrush () const
Qt::BGMode backgroundMode () const
QFont font () const
QMatrix matrix () const
Qt::ClipOperation clipOperation () const
QRegion clipRegion () const
QPainterPath clipPath () const
bool isClipEnabled () const
QPainter::RenderHints renderHints () const
QPainter::CompositionMode compositionMode () const
qreal opacity () const
QPainterpainter () const

Protected Attributes

QPaintEngine::DirtyFlags dirtyFlags

Friends

class QPaintEngine
class QPainter
class QPainterPrivate


Member Function Documentation

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

See also:
QPaintEngine::updateState()

Definition at line 248 of file qpaintengine.h.

Referenced by QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), QPicturePaintEngine::updateState(), and QPainterPrivate::updateState().

00248 { return dirtyFlags; }

QPen QPaintEngineState::pen (  )  const

Returns the pen in the current paint engine state.

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

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

Definition at line 6515 of file qpainter.cpp.

Referenced by QPaintEngine::drawTextItem(), QPainterState::init(), QPainterState::QPainterState(), QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06516 {
06517     return static_cast<const QPainterState *>(this)->pen;
06518 }

QBrush QPaintEngineState::brush (  )  const

Returns the brush in the current paint engine state.

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

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

Definition at line 6529 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06530 {
06531     return static_cast<const QPainterState *>(this)->brush;
06532 }

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 6543 of file qpainter.cpp.

Referenced by QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06544 {
06545     return static_cast<const QPainterState *>(this)->bgOrigin;
06546 }

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 6557 of file qpainter.cpp.

Referenced by Q3SVGPaintEngine::updateState(), and QPicturePaintEngine::updateState().

06558 {
06559     return static_cast<const QPainterState *>(this)->bgBrush;
06560 }

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 6572 of file qpainter.cpp.

Referenced by Q3SVGPaintEngine::updateState(), and QPicturePaintEngine::updateState().

06573 {
06574     return static_cast<const QPainterState *>(this)->bgMode;
06575 }

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 6587 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06588 {
06589     return static_cast<const QPainterState *>(this)->font;
06590 }

QMatrix QPaintEngineState::matrix (  )  const

Since:
4.2
Returns the matrix in the current paint engine state.

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 6604 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06605 {
06606     return static_cast<const QPainterState *>(this)->matrix;
06607 }

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 6620 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06621 {
06622     return static_cast<const QPainterState *>(this)->clipOperation;
06623 }

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 6634 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06635 {
06636     return static_cast<const QPainterState *>(this)->clipRegion;
06637 }

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 6648 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), Q3SVGPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06649 {
06650     return static_cast<const QPainterState *>(this)->clipPath;
06651 }

bool QPaintEngineState::isClipEnabled (  )  const

Returns wether 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 6664 of file qpainter.cpp.

Referenced by QPdfBaseEngine::updateState(), QRasterPaintEngine::updateState(), and QX11PaintEngine::updateState().

06665 {
06666     return static_cast<const QPainterState *>(this)->clipEnabled;
06667 }

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 6679 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QRasterPaintEngine::updateState(), QX11PaintEngine::updateState(), and QPicturePaintEngine::updateState().

06680 {
06681     return static_cast<const QPainterState *>(this)->renderHints;
06682 }

QPainter::CompositionMode QPaintEngineState::compositionMode (  )  const

Returns the composition mode in the current paint engine state.

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

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

Definition at line 6694 of file qpainter.cpp.

Referenced by QRasterPaintEngine::updateState(), and QX11PaintEngine::updateState().

06695 {
06696     return static_cast<const QPainterState *>(this)->composition_mode;
06697 }

qreal QPaintEngineState::opacity (  )  const

Since:
4.2
Returns the opacity in the current paint engine state.

Definition at line 6717 of file qpainter.cpp.

Referenced by QPainterState::init(), QPainterState::QPainterState(), QRasterPaintEngine::updateState(), and QX11PaintEngine::updateState().

06718 {
06719     return static_cast<const QPainterState *>(this)->opacity;
06720 }

QPainter * QPaintEngineState::painter (  )  const

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

Definition at line 6705 of file qpainter.cpp.

Referenced by QPainterState::init(), QPaintEngine::painter(), QPainterState::QPainterState(), and QPainterPrivate::updateState().

06706 {
06707     return static_cast<const QPainterState *>(this)->painter;
06708 }


Friends And Related Function Documentation

friend class QPaintEngine [friend]

Definition at line 270 of file qpaintengine.h.

friend class QPainter [friend]

Definition at line 271 of file qpaintengine.h.

friend class QPainterPrivate [friend]

Definition at line 272 of file qpaintengine.h.


Member Data Documentation

QPaintEngine::DirtyFlags QPaintEngineState::dirtyFlags [protected]

Definition at line 274 of file qpaintengine.h.

Referenced by QPaintEngine::clearDirty(), QPainterState::init(), QPainterState::QPainterState(), QPainter::restore(), QPaintEngine::setDirty(), QPaintEngine::testDirty(), QPainterPrivate::updateMatrix(), and QPainterPrivate::updateState().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 18:33:39 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1