QSGFlatColorMaterial Class

The QSGFlatColorMaterial class provides a convenient way of rendering solid colored geometry in the scene graph. 更多...

頭: #include <QSGFlatColorMaterial>
qmake: QT += quick
繼承: QSGMaterial

公共函數

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

詳細描述

警告: This utility class is only functional when running with the default backend of the Qt Quick scenegraph.

The flat color material will fill every pixel in a geometry using a solid color. The color can contain transparency.

The geometry to be rendered with a flat color material requires vertices in attribute location 0 in the QSGGeometry object to render correctly. The QSGGeometry::defaultAttributes_Point2D () returns an attribute set compatible with this material.

The flat color material respects both current opacity and current matrix when updating its rendering state.

成員函數文檔編製

QSGFlatColorMaterial:: QSGFlatColorMaterial ()

Constructs a new flat color material.

默認顔色為白色。

const QColor &QSGFlatColorMaterial:: color () const

Returns this flat color material's color.

默認顔色為白色。

另請參閱 setColor ().

void QSGFlatColorMaterial:: setColor (const QColor & color )

Sets this flat color material's color to color .

另請參閱 color ().