Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
colorpicker.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QtCore/qobject.h>
5#include <QtCore/qproperty.h>
6#include <QtQml/qqmlregistration.h>
7#include <QtGui/qcolor.h>
8
9class MyColorPicker : public QObject
10{
13 // Stores a value in the range [0, 1); myApp.qml type sets this with
14 // Math.random()
16
17 QProperty<double> m_encodedColor{0.5};
18public:
20
21 double encodedColor() { return m_encodedColor; }
22 void setEncodedColor(double value);
23 QBindable<double> bindableEncodedColor();
24
25 // Returns a QColor "decoded" from encodedColor
27};
double encodedColor()
Definition colorpicker.h:21
QML_ELEMENTdouble encodedColor
Definition colorpicker.h:15
MyColorPicker(QObject *parent=nullptr)
Definition colorpicker.h:19
Q_INVOKABLE QColor decodeColor()
QBindable< double > bindableEncodedColor()
void setEncodedColor(double value)
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define QML_ELEMENT
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE