Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickcolorinputs_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKCOLORINPUTS_P_H
6#define QQUICKCOLORINPUTS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/qcolor.h>
20#include <QtQmlModels/private/qqmldelegatemodel_p.h>
21#include <QtQuick/private/qquickitem_p.h>
22#include <QtQuickTemplates2/private/qquicktextfield_p.h>
23#include <QtQuickTemplates2/private/qquickcontainer_p.h>
24
26
28
29#include <QtCore/qpointer.h>
30
32
34
35class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickColorInputs : public QQuickContainer
36{
37 Q_OBJECT
38 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
39 Q_PROPERTY(int red READ red NOTIFY colorChanged FINAL)
40 Q_PROPERTY(int green READ green NOTIFY colorChanged FINAL)
41 Q_PROPERTY(int blue READ blue NOTIFY colorChanged FINAL)
42 Q_PROPERTY(qreal hue READ hue NOTIFY colorChanged FINAL)
43 Q_PROPERTY(qreal hslSaturation READ hslSaturation NOTIFY colorChanged FINAL)
44 Q_PROPERTY(qreal hsvSaturation READ hsvSaturation NOTIFY colorChanged FINAL)
45 Q_PROPERTY(qreal value READ value NOTIFY colorChanged FINAL)
46 Q_PROPERTY(qreal lightness READ lightness NOTIFY colorChanged FINAL)
47 Q_PROPERTY(qreal alpha READ alpha NOTIFY colorChanged FINAL)
48 Q_PROPERTY(bool showAlpha READ showAlpha WRITE setShowAlpha NOTIFY showAlphaChanged FINAL)
49 Q_PROPERTY(Mode mode READ currentMode WRITE setCurrentMode NOTIFY currentModeChanged FINAL)
50 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
51 QML_NAMED_ELEMENT(ColorInputsImpl)
52 QML_ADDED_IN_VERSION(6, 9)
53
54public:
55 explicit QQuickColorInputs(QQuickItem *parent = nullptr);
56
57 enum Mode {
58 Hex = 0,
59 Rgb,
60 Hsv,
61 Hsl
62 };
63 Q_ENUM(Mode);
64
65 Mode currentMode() const;
66 void setCurrentMode(Mode mode);
67
68 QQmlComponent *delegate() const;
69 void setDelegate(QQmlComponent *delegate);
70
71 QColor color() const;
72 void setColor(const QColor &c);
73 int red() const;
74 int green() const;
75 int blue() const;
76 qreal alpha() const;
77 qreal hue() const;
78 qreal hslSaturation() const;
79 qreal hsvSaturation() const;
80 qreal value() const;
81 qreal lightness() const;
82
83 bool showAlpha() const;
84 void setShowAlpha(bool showAlpha);
85
86Q_SIGNALS:
87 void colorChanged(const QColor &c);
88 void colorModified(const QColor &c);
89 void hslChanged();
90 void showAlphaChanged(bool);
91 void currentModeChanged();
92 void delegateChanged();
93
94protected:
95 void componentComplete() override;
96
97private:
98 Q_DISABLE_COPY(QQuickColorInputs)
99 Q_DECLARE_PRIVATE(QQuickColorInputs)
100};
101
102QT_END_NAMESPACE
103
104#endif // QQUICKCOLORINPUTS_P_H
QPointer< QQuickAbstractButton > eyeDropperButton
QPointer< QQuickDialogButtonBox > buttonBox
QPointer< QQuickAbstractColorPicker > colorPicker
std::unique_ptr< QQuickEyeDropperEventFilter > eyeDropperEventFilter
void eyeDropperLeave(const QPoint &pos, QQuickEyeDropperEventFilter::LeaveReason actionOnLeave)
Q_DECLARE_PUBLIC(QQuickColorDialogImpl)
void handleClick(QQuickAbstractButton *button) override
QSharedPointer< QColorDialogOptions > options
static QQuickColorDialogImplPrivate * get(QQuickColorDialogImpl *dialog)
QQuickColorDialogImplAttached * attachedOrWarn()
void eyeDropperPointerMoved(const QPoint &pos)
QPointer< QQuickWindow > m_eyeDropperWindow
QQuickEyeDropperEventFilter(std::function< void(QPoint, LeaveReason)> callOnLeave, std::function< void(QPoint)> callOnUpdate)
bool eventFilter(QObject *obj, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.