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_P_H
5#define QQUICKABSTRACTCOLORPICKER_P_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 <QtQuickTemplates2/private/qquickcontrol_p_p.h>
19#include <QtQuickTemplates2/private/qquickdeferredexecute_p_p.h>
20
21#include "qquickabstractcolorpicker_p.h"
22#include "qquickcolordialogutils_p.h"
23
24QT_BEGIN_NAMESPACE
25
26class QQuickAbstractColorPickerPrivate : public QQuickControlPrivate
27{
28 Q_DECLARE_PUBLIC(QQuickAbstractColorPicker);
29
30public:
31 explicit QQuickAbstractColorPickerPrivate();
32
33 static QQuickAbstractColorPickerPrivate *get(QQuickAbstractColorPicker *colorPicker)
34 {
35 return colorPicker->d_func();
36 }
37
38 bool handlePress(const QPointF &point, ulong timestamp) override;
39 bool handleMove(const QPointF &point, ulong timestamp) override;
40 bool handleRelease(const QPointF &point, ulong timestamp) override;
41 void handleUngrab() override;
42
43 void cancelHandle();
44 void executeHandle(bool complete = false);
45
46 void itemImplicitWidthChanged(QQuickItem *item) override;
47 void itemImplicitHeightChanged(QQuickItem *item) override;
48
49 HSVA m_hsva;
50 QPointF m_pressPoint;
51 QQuickDeferredPointer<QQuickItem> m_handle;
52 bool m_pressed = false;
53
54protected:
55 bool m_hsl = false; // Use hsv by default.
56};
57
58QT_END_NAMESPACE
59
60#endif // QQUICKABSTRACTCOLORPICKER_P_P_H
61

source code of qtdeclarative/src/quickdialogs/quickdialogsquickimpl/qquickabstractcolorpicker_p_p.h