QSGSimpleRectNode Class

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

頭: #include <QSGSimpleRectNode>
qmake: QT += quick
繼承: QSGGeometryNode

該類已過時。 提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

公共函數

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.

警告: 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 憑藉 QQuickWindow::createRectangleNode () 或 QSGEngine::createRectangleNode ().

成員函數文檔編製

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

構造 QSGSimpleRectNode instance which is spanning rect with the color color .

QSGSimpleRectNode:: QSGSimpleRectNode ()

構造 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 )

這是重載函數。

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