QSGOpacityNodeclass is used to change opacity of nodes. 更多 …
def
combinedOpacity
()
def
opacity
()
def
setCombinedOpacity
(opacity)
def
setOpacity
(opacity)
Opacity applies to its subtree and can be nested. Multiple opacity nodes will be accumulated by multiplying their opacity. The accumulation happens as part of the rendering.
When nested opacity gets below a certain threshold, the subtree might be marked as blocked, causing
isSubtreeBlocked()to return true. This is done for performance reasons.注意
All classes with QSG prefix should be used solely on the scene graph’s rendering thread. See 场景图形和渲染 了解更多信息。
QSGOpacityNode
¶
Constructs an opacity node with a default opacity of 1.
Opacity accumulates downwards in the scene graph so a node with two
QSGOpacityNode
instances above it, both with opacity of 0.5, will have effective opacity of 0.25.
节点的默认不透明度为 1。
PySide2.QtQuick.QSGOpacityNode.
combinedOpacity
(
)
¶
qreal
PySide2.QtQuick.QSGOpacityNode.
opacity
(
)
¶
qreal
Returns this opacity node’s opacity.
另请参阅
PySide2.QtQuick.QSGOpacityNode.
setCombinedOpacity
(
opacity
)
¶
opacity
–
qreal
Sets the combined opacity of this node to
opacity
.
This function is meant to be called by the node preprocessing prior to rendering the tree, so it will not mark the tree as dirty.
PySide2.QtQuick.QSGOpacityNode.
setOpacity
(
opacity
)
¶
opacity
–
qreal
Sets the opacity of this node to
opacity
.
Before rendering the graph, the renderer will do an update pass over the subtree to propagate the opacity to its children.
The value will be bounded to the range 0 to 1.
另请参阅