QSGRectangleNode Class

QSGRectangleNode 类是使用场景图绘制实心填充矩形的方便类。更多

页首 #include <QSGRectangleNode>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
继承: QSGGeometryNode

公共函数

virtual QColor color() const = 0
virtual QRectF rect() const = 0
virtual void setColor(const QColor &color) = 0
virtual void setRect(const QRectF &rect) = 0
void setRect(qreal x, qreal y, qreal w, qreal h)

详细说明

成员函数文档

[pure virtual] QColor QSGRectangleNode::color() const

返回此矩形的颜色。

另请参阅 setColor()。

[pure virtual] QRectF QSGRectangleNode::rect() const

返回此矩形节点覆盖的矩形区域。

另请参阅 setRect()。

[pure virtual] void QSGRectangleNode::setColor(const QColor &color)

将此矩形的颜色设置为color 。默认颜色为白色。

另请参阅 color().

[pure virtual] void QSGRectangleNode::setRect(const QRectF &rect)

将此 rect 节点的矩形设置为rect

另请参见 rect()。

void QSGRectangleNode::setRect(qreal x, qreal y, qreal w, qreal h)

这是一个重载函数。

设置此矩形节点的矩形以 (x,y) 为起点,宽度为w ,高度为h

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