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
qquickcolordialog_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 QQUICKCOLORDIALOG_P_H
6#define QQUICKCOLORDIALOG_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
20
21#include <QtGui/qcolor.h>
22
24
25class Q_QUICKDIALOGS2_EXPORT QQuickColorDialog : public QQuickAbstractDialog
26{
27 Q_OBJECT
28 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor NOTIFY selectedColorChanged)
29 Q_PROPERTY(QColorDialogOptions::ColorDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged)
30 QML_EXTENDED_NAMESPACE(QColorDialogOptions)
31 QML_NAMED_ELEMENT(ColorDialog)
32 QML_ADDED_IN_VERSION(6, 4)
33
34public:
35 explicit QQuickColorDialog(QObject *parent = nullptr);
36
37 QColor selectedColor() const;
38 void setSelectedColor(const QColor &color);
39
40 QColorDialogOptions::ColorDialogOptions options() const;
41 void setOptions(QColorDialogOptions::ColorDialogOptions options);
42 void resetOptions();
43
44Q_SIGNALS:
45 void selectedColorChanged();
46 void optionsChanged();
47
48protected:
49 bool useNativeDialog() const override;
50 void onCreate(QPlatformDialogHelper *dialog) override;
51 void onShow(QPlatformDialogHelper *dialog) override;
52
53private:
54 QSharedPointer<QColorDialogOptions> m_options;
55 QColor m_selectedColor;
56};
57
58QT_END_NAMESPACE
59
60#endif // QQUICKCOLORDIALOG_P_H