Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsgflatcolormaterial.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSGFLATCOLORMATERIAL_H
5#define QSGFLATCOLORMATERIAL_H
6
7#include <QtQuick/qsgmaterial.h>
8#include <QtGui/qcolor.h>
9
11
12class Q_QUICK_EXPORT QSGFlatColorMaterial : public QSGMaterial
13{
14public:
16 QSGMaterialType *type() const override;
18
19 void setColor(const QColor &color);
20 const QColor &color() const { return m_color; }
21
22 int compare(const QSGMaterial *other) const override;
23
24private:
25 QColor m_color;
26};
27
29
30#endif // FLATCOLORMATERIAL_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QSGFlatColorMaterial class provides a convenient way of rendering solid colored geometry in the s...
const QColor & color() const
Returns this flat color material's color.
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
Definition qsgmaterial.h:15
virtual QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const =0
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
virtual int compare(const QSGMaterial *other) const
Compares this material to other and returns 0 if they are equal; -1 if this material should sort befo...
virtual QSGMaterialType * type() const =0
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
Combined button and popup list for selecting options.
QSharedPointer< T > other(t)
[5]
myFilter setColor(QColor(128, 0, 0))
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.