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
qquickabstractcolorpicker_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QQUICKABSTRACTCOLORPICKER_P_H
5#define QQUICKABSTRACTCOLORPICKER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qcolor.h>
19#include <QtQuickTemplates2/private/qquickcontrol_p.h>
20
22
24
26
27class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickAbstractColorPicker : public QQuickControl
28{
31 Q_PROPERTY(qreal hue READ hue WRITE setHue NOTIFY colorChanged)
32 Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation NOTIFY colorChanged)
34 Q_PROPERTY(qreal lightness READ lightness WRITE setLightness NOTIFY colorChanged)
35 Q_PROPERTY(qreal alpha READ alpha WRITE setAlpha NOTIFY colorChanged FINAL)
36 Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL)
37 Q_PROPERTY(QQuickItem *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL)
38 Q_PROPERTY(qreal implicitHandleWidth READ implicitHandleWidth NOTIFY implicitHandleWidthChanged FINAL)
39 Q_PROPERTY(qreal implicitHandleHeight READ implicitHandleHeight NOTIFY implicitHandleHeightChanged FINAL)
40 Q_CLASSINFO("DeferredPropertyNames", "background,contentItem,handle")
41 QML_NAMED_ELEMENT(AbstractColorPicker)
43 QML_UNCREATABLE("AbstractColorPicker is abstract.")
44
45public:
46 QColor color() const;
47 void setColor(const QColor &c);
48
49 qreal hue() const;
50 void setHue(qreal hue);
51
52 qreal saturation() const;
53 void setSaturation(qreal saturation);
54
55 qreal value() const;
56 void setValue(qreal value);
57
58 qreal lightness() const;
59 void setLightness(qreal lightness);
60
61 qreal alpha() const;
62 void setAlpha(qreal alpha);
63
64 bool isPressed() const;
65 void setPressed(bool pressed);
66
67 QQuickItem *handle() const;
68 void setHandle(QQuickItem *handle);
69
70 qreal implicitHandleWidth() const;
71 qreal implicitHandleHeight() const;
72
75 void pressedChanged();
76 void handleChanged();
77 void implicitHandleWidthChanged();
78 void implicitHandleHeightChanged();
79
80 void colorPicked(const QColor &color);
81
82protected:
84
85 virtual QColor colorAt(const QPointF &pos) = 0;
86 void componentComplete() override;
87
89 void updateColor(const QPointF &pos);
90 Q_DISABLE_COPY(QQuickAbstractColorPicker)
91 Q_DECLARE_PRIVATE(QQuickAbstractColorPicker)
92};
93
95
96#endif // QQUICKABSTRACTCOLORPICKER_P_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
void colorChanged()
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint64 GLenum void * handle
GLuint color
[2]
const GLubyte * c
GLfloat GLfloat GLfloat alpha
Definition qopenglext.h:418
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
settings setValue("DataPump/bgcolor", color)
myFilter setColor(QColor(128, 0, 0))