QSGSimpleRectNode Class

The QSGSimpleRectNode class is a convenience class for drawing solid filled rectangles using scenegraph. 更多...

头文件: #include <QSGSimpleRectNode>
qmake: QT += quick
基类: QSGGeometryNode

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

公有函数

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

详细描述

The QSGSimpleRectNode class is a convenience class for drawing solid filled rectangles using scenegraph.

Warning: This utility class is only functional when running with the OpenGL or software backends of the Qt Quick scenegraph. For a proper cross-platform alternative prefer using QSGRectangleNode via QQuickWindow::createRectangleNode() or QSGEngine::createRectangleNode().

成员函数

QSGSimpleRectNode::QSGSimpleRectNode(const QRectF &rect, const QColor &color)

Constructs a QSGSimpleRectNode instance which is spanning rect with the color color.

QSGSimpleRectNode::QSGSimpleRectNode()

Constructs a QSGSimpleRectNode instance with an empty rectangle and white color.

QColor QSGSimpleRectNode::color() const

Returns the color of this rectangle.

参见 setColor().

QRectF QSGSimpleRectNode::rect() const

Returns the rectangle that this rect node covers.

参见 setRect().

void QSGSimpleRectNode::setColor(const QColor &color)

Sets the color of this rectangle to color. The default color will be white.

参见 color().

void QSGSimpleRectNode::setRect(const QRectF &rect)

Sets the rectangle of this rect node to rect.

参见 rect().

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

This is an overloaded function.

Sets the rectangle of this rect node to begin at (x, y) and have width w and height h.