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
qquickcolordialogimpl_p_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKCOLORDIALOGIMPL_P_P_H
6#define QQUICKCOLORDIALOGIMPL_P_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
22
23#include <QtQuickTemplates2/private/qquickdialog_p_p.h>
24#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
25#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
26#include <QtQuickTemplates2/private/qquickslider_p.h>
27
28#include <QtCore/qpointer.h>
29
31
33{
34public:
35 enum class LeaveReason { Default, Cancel };
36 explicit QQuickEyeDropperEventFilter(std::function<void(QPoint, LeaveReason)> callOnLeave,
37 std::function<void(QPoint)> callOnUpdate)
39 {
40 }
41
42protected:
43 bool eventFilter(QObject *obj, QEvent *event) override;
44
45private:
46 std::function<void(QPoint, LeaveReason)> m_leave;
47 std::function<void(QPoint)> m_update;
48 QPoint m_lastPosition;
49};
50
52{
53public:
55
56public:
59
60 static QQuickColorDialogImplPrivate *get(QQuickColorDialogImpl *dialog)
61 {
62 return dialog->d_func();
63 }
64
65 QQuickColorDialogImplAttached *attachedOrWarn();
66
67 void handleClick(QQuickAbstractButton *button) override;
68
69 void eyeDropperEnter();
70 void eyeDropperLeave(const QPoint &pos, QQuickEyeDropperEventFilter::LeaveReason actionOnLeave);
71 void eyeDropperPointerMoved(const QPoint &pos);
72
73 void alphaSliderMoved();
74
80 bool m_eyeDropperMode = false;
81 bool m_showAlpha = false;
82 bool m_hsl = false;
83};
84
96
97QT_END_NAMESPACE
98
99#endif // QQUICKCOLORDIALOGIMPL_P_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.