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
4#ifndef QQUICKLABSPLATFORMCOLORDIALOG_P_H
5#define QQUICKLABSPLATFORMCOLORDIALOG_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
19#include <QtGui/qcolor.h>
20#include <QtQml/qqml.h>
21
23
25{
26 Q_OBJECT
27 QML_NAMED_ELEMENT(ColorDialog)
32
33public:
34 explicit QQuickLabsPlatformColorDialog(QObject *parent = nullptr);
35
36 QColor color() const;
37 void setColor(const QColor &color);
38
39 QColor currentColor() const;
40 void setCurrentColor(const QColor &color);
41
43 void setOptions(QColorDialogOptions::ColorDialogOptions options);
44
49
50protected:
51 bool useNativeDialog() const override;
52 void onCreate(QPlatformDialogHelper *dialog) override;
53 void onShow(QPlatformDialogHelper *dialog) override;
54 void accept() override;
55
56private:
57 QColor m_color;
58 QColor m_currentColor; // TODO: QColorDialogOptions::initialColor
59 QSharedPointer<QColorDialogOptions> m_options;
60};
61
62QT_END_NAMESPACE
63
64#endif // QQUICKLABSPLATFORMCOLORDIALOG_P_H
\inmodule QtCore
Definition qobject.h:103
QColorDialogOptions::ColorDialogOptions options() const
\qmlproperty flags Qt.labs.platform::ColorDialog::options
void accept() override
\qmlmethod void Qt.labs.platform::Dialog::accept()
void onCreate(QPlatformDialogHelper *dialog) override
void onShow(QPlatformDialogHelper *dialog) override
void setOptions(QColorDialogOptions::ColorDialogOptions options)
QColor currentColor() const
\qmlproperty color Qt.labs.platform::ColorDialog::currentColor
QColor color() const
\qmlproperty color Qt.labs.platform::ColorDialog::color
virtual void accept()
\qmlmethod void Qt.labs.platform::Dialog::accept()
Combined button and popup list for selecting options.