QSGClipNode Class
QSGClipNode 类实现了场景图中的剪切功能。更多
Header: | #include <QSGClipNode> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick) |
qmake: | QT += quick |
继承: | QSGBasicGeometryNode |
- 所有成员(包括继承成员)的列表
- QSGClipNode 是Qt Quick 场景图节点类的一部分。
公共函数
QSGClipNode() | |
virtual | ~QSGClipNode() override |
QRectF | clipRect() const |
bool | isRectangular() const |
void | setClipRect(const QRectF &rect) |
void | setIsRectangular(bool rectHint) |
详细说明
剪切适用于节点的子树,可以嵌套。多个剪辑节点将通过与它们的所有几何图形相交来累积。累积是渲染的一部分。
剪辑节点在添加到场景图之前必须有一个几何体。
剪切通常通过使用模板缓冲区来实现。
注意: 所有带有 QSG 前缀的类都只能在场景图的渲染线程中使用。更多信息,请参阅场景图和渲染。
成员函数文档
QSGClipNode::QSGClipNode()
创建一个没有几何体的新 QSGClipNode。
剪辑节点在添加到场景图之前必须有一个几何体。
[override virtual noexcept]
QSGClipNode::~QSGClipNode()
删除此QSGClipNode 。
如果设置了QSGNode::OwnsGeometry 标志,几何体也将被删除。
QRectF QSGClipNode::clipRect() const
返回此节点的剪辑矩形。
另请参阅 setClipRect()。
bool QSGClipNode::isRectangular() const
返回此剪辑节点是否具有矩形剪辑。
另请参阅 setIsRectangular()。
void QSGClipNode::setClipRect(const QRectF &rect)
将此剪辑节点的剪辑矩形设置为rect 。
当矩形剪辑与setIsRectangular 结合使用时,渲染器在某些情况下可能会使用更理想的剪辑方法。
另请参阅 clipRect()。
void QSGClipNode::setIsRectangular(bool rectHint)
将此剪辑节点是否具有矩形剪辑设置为rectHint 。
这是一个优化提示,意味着渲染器可以使用剪刀剪切来代替模版,从而大大提高速度。
设置此提示且适用时,剪辑区域将从clipRect() 而非geometry() 生成。
默认情况下,此属性为false
。
另请参阅 isRectangular()。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.