QSGFlatColorMaterial Class

Die Klasse QSGFlatColorMaterial bietet eine bequeme Möglichkeit, einfarbige Geometrie im Szenegraph darzustellen. Mehr...

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

Öffentliche Funktionen

QSGFlatColorMaterial()
const QColor &color() const
void setColor(const QColor &color)

Detaillierte Beschreibung

Warnung: Diese Utility-Klasse ist nur funktionsfähig, wenn sie mit dem Standard-Backend von Qt Quick scenegraph läuft.

Das FlatColorMaterial füllt jedes Pixel in einer Geometrie mit einer Volltonfarbe. Die Farbe kann Transparenz enthalten.

Die Geometrie, die mit einem Flat-Color-Material gerendert werden soll, benötigt Vertices an der Attributposition 0 im QSGGeometry -Objekt, um korrekt gerendert zu werden. Die Funktion QSGGeometry::defaultAttributes_Point2D() gibt einen Attributsatz zurück, der mit diesem Material kompatibel ist.

Das Flat-Color-Material beachtet sowohl die aktuelle Deckkraft als auch die aktuelle Matrix, wenn es seinen Rendering-Status aktualisiert.

Dokumentation der Mitgliedsfunktionen

QSGFlatColorMaterial::QSGFlatColorMaterial()

Konstruiert ein neues flaches Farbmaterial.

Die Standardfarbe ist weiß.

const QColor &QSGFlatColorMaterial::color() const

Gibt die Farbe dieses flachen Farbmaterials zurück.

Die Standardfarbe ist weiß.

Siehe auch setColor().

void QSGFlatColorMaterial::setColor(const QColor &color)

Setzt die Farbe dieses flachen Farbmaterials auf color.

Siehe auch color().

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