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
qquicklabsplatformcolordialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKLABSPLATFORMCOLORDIALOG_P_H
6#define QQUICKLABSPLATFORMCOLORDIALOG_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#include <QtGui/qcolor.h>
21#include <QtQml/qqml.h>
22
23#if QT_DEPRECATED_SINCE(6, 9)
24
25QT_BEGIN_NAMESPACE
26
27class QQuickLabsPlatformColorDialog : public QQuickLabsPlatformDialog
28{
29 Q_OBJECT
30 QML_NAMED_ELEMENT(ColorDialog)
31 QML_ADDED_IN_VERSION(1, 0)
32 QML_EXTENDED_NAMESPACE(QColorDialogOptions)
33 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
34 Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged FINAL)
35 Q_PROPERTY(QColorDialogOptions::ColorDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
36
37public:
38 explicit QQuickLabsPlatformColorDialog(QObject *parent = nullptr);
39
40 QColor color() const;
41 void setColor(const QColor &color);
42
43 QColor currentColor() const;
44 void setCurrentColor(const QColor &color);
45
46 QColorDialogOptions::ColorDialogOptions options() const;
47 void setOptions(QColorDialogOptions::ColorDialogOptions options);
48
49Q_SIGNALS:
50 void colorChanged();
51 void currentColorChanged();
52 void optionsChanged();
53
54protected:
55 bool useNativeDialog() const override;
56 void onCreate(QPlatformDialogHelper *dialog) override;
57 void onShow(QPlatformDialogHelper *dialog) override;
58 void accept() override;
59
60private:
61 QColor m_color;
62 QColor m_currentColor; // TODO: QColorDialogOptions::initialColor
63 QSharedPointer<QColorDialogOptions> m_options;
64};
65
66QT_END_NAMESPACE
67
68#endif // QT_DEPRECATED_SINCE(6, 9)
69
70#endif // QQUICKLABSPLATFORMCOLORDIALOG_P_H