内容表

上一话题

QPaintEngine

下一话题

QPaintEvent

QPaintEngineState

QPaintEngineState class provides information about the active paint engine’s current state. 更多

Inheritance diagram of PySide2.QtGui.QPaintEngineState

详细描述

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 DirtyFlags type which stores an OR combination of DirtyFlag values. The 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

DirtyBackground

backgroundBrush()

DirtyBackgroundMode

backgroundMode()

DirtyBrush

brush()

DirtyBrushOrigin

brushOrigin()

DirtyClipRegion or DirtyClipPath

clipOperation()

DirtyClipPath

clipPath()

DirtyClipRegion

clipRegion()

DirtyCompositionMode

compositionMode()

DirtyFont

font()

DirtyTransform

transform()

DirtyClipEnabled

isClipEnabled()

DirtyPen

pen()

DirtyHints

renderHints()

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 updateState() function. The only situation in which you will have to use this class directly is when implementing your own paint engine.

另请参阅

QPaintEngine

class QPaintEngineState
PySide2.QtGui.QPaintEngineState. dirtyFlags
PySide2.QtGui.QPaintEngineState. backgroundBrush ( )
返回类型

QBrush

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 DirtyBackground 标志。

PySide2.QtGui.QPaintEngineState. backgroundMode ( )
返回类型

BGMode

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 DirtyBackgroundMode 标志。

PySide2.QtGui.QPaintEngineState. brush ( )
返回类型

QBrush

Returns the brush in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the DirtyBrush 标志。

PySide2.QtGui.QPaintEngineState. brushNeedsResolving ( )
返回类型

bool

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

PySide2.QtGui.QPaintEngineState. brushOrigin ( )
返回类型

QPointF

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 DirtyBrushOrigin 标志。

PySide2.QtGui.QPaintEngineState. clipOperation ( )
返回类型

ClipOperation

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 DirtyClipPath DirtyClipRegion 标志。

PySide2.QtGui.QPaintEngineState. clipPath ( )
返回类型

QPainterPath

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 DirtyClipPath 标志。

PySide2.QtGui.QPaintEngineState. clipRegion ( )
返回类型

QRegion

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 DirtyClipRegion 标志。

PySide2.QtGui.QPaintEngineState. compositionMode ( )
返回类型

CompositionMode

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 DirtyCompositionMode 标志。

PySide2.QtGui.QPaintEngineState. font ( )
返回类型

QFont

Returns the font in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the DirtyFont 标志。

PySide2.QtGui.QPaintEngineState. isClipEnabled ( )
返回类型

bool

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 DirtyClipEnabled 标志。

PySide2.QtGui.QPaintEngineState. matrix ( )
返回类型

QMatrix

注意

此函数被弃用。

使用 transform() 代替。

Returns the matrix in the current paint engine state.

注意

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 DirtyTransform 标志。

PySide2.QtGui.QPaintEngineState. opacity ( )
返回类型

qreal

Returns the opacity in the current paint engine state.

PySide2.QtGui.QPaintEngineState. painter ( )
返回类型

QPainter

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

PySide2.QtGui.QPaintEngineState. pen ( )
返回类型

QPen

Returns the pen in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the DirtyPen 标志。

PySide2.QtGui.QPaintEngineState. penNeedsResolving ( )
返回类型

bool

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

PySide2.QtGui.QPaintEngineState. renderHints ( )
返回类型

RenderHints

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 DirtyHints 标志。

PySide2.QtGui.QPaintEngineState. state ( )
返回类型

DirtyFlags

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 updateState() 函数)。

另请参阅

updateState()

PySide2.QtGui.QPaintEngineState. transform ( )
返回类型

QTransform

Returns the matrix in the current paint engine state.

This variable should only be used when the state() returns a combination which includes the DirtyTransform 标志。