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_EXTENDED_NAMESPACE(QColorDialogOptions)
32 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
33 Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged FINAL)
34 Q_PROPERTY(QColorDialogOptions::ColorDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
35
36public:
37 explicit QQuickLabsPlatformColorDialog(QObject *parent = nullptr);
38
39 QColor color() const;
40 void setColor(const QColor &color);
41
42 QColor currentColor() const;
43 void setCurrentColor(const QColor &color);
44
45 QColorDialogOptions::ColorDialogOptions options() const;
46 void setOptions(QColorDialogOptions::ColorDialogOptions options);
47
48Q_SIGNALS:
49 void colorChanged();
50 void currentColorChanged();
51 void optionsChanged();
52
53protected:
54 bool useNativeDialog() const override;
55 void onCreate(QPlatformDialogHelper *dialog) override;
56 void onShow(QPlatformDialogHelper *dialog) override;
57 void accept() override;
58
59private:
60 QColor m_color;
61 QColor m_currentColor; // TODO: QColorDialogOptions::initialColor
62 QSharedPointer<QColorDialogOptions> m_options;
63};
64
65QT_END_NAMESPACE
66
67#endif // QT_DEPRECATED_SINCE(6, 9)
68
69#endif // QQUICKLABSPLATFORMCOLORDIALOG_P_H