QSGSimpleRectNode Class

Die Klasse QSGSimpleRectNode ist eine Komfortklasse zum Zeichnen von gefüllten Rechtecken mit Scenegraph. Mehr...

Kopfzeile: #include <QSGSimpleRectNode>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Vererbungen: QSGGeometryNode

Öffentliche Funktionen

QSGSimpleRectNode()
QSGSimpleRectNode(const QRectF &rect, const QColor &color)
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)

Detaillierte Beschreibung

Warnung: Diese Dienstleistungsklasse ist nur funktionsfähig, wenn sie mit den Standard- oder Software-Backends des Qt Quick scenegraph ausgeführt wird. Als Alternative sollten Sie QSGRectangleNode über QQuickWindow::createRectangleNode() verwenden. Diese eigenständige Klasse ist jedoch immer noch nützlich, wenn sie über eine Unterklasse verwendet wird und die Anwendung weiß, dass keine speziellen Scenegraph-Backends beteiligt sind.

Dokumentation der Mitgliedsfunktionen

QSGSimpleRectNode::QSGSimpleRectNode()

Konstruiert eine QSGSimpleRectNode-Instanz mit einem leeren Rechteck und weißer Farbe.

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

Konstruiert eine QSGSimpleRectNode-Instanz, die rect mit der Farbe color aufspannt.

QColor QSGSimpleRectNode::color() const

Gibt die Farbe dieses Rechtecks zurück.

Siehe auch setColor().

QRectF QSGSimpleRectNode::rect() const

Gibt das Rechteck zurück, das dieser Rect-Knoten abdeckt.

Siehe auch setRect().

void QSGSimpleRectNode::setColor(const QColor &color)

Setzt die Farbe dieses Rechtecks auf color. Die Standardfarbe ist weiß.

Siehe auch color().

void QSGSimpleRectNode::setRect(const QRectF &rect)

Setzt das Rechteck dieses rect-Knotens auf rect.

Siehe auch rect().

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

Dies ist eine überladene Funktion.

Legt das Rechteck dieses Rect-Knotens so fest, dass es bei (x, y) beginnt und die Breite w und die Höhe h hat.

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