aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/platform/qquickplatformcolordialog_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-13 13:40:36 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-08-14 09:25:52 +0000
commitfb05eafac51a602c8c090c76584ece6b7da2034c (patch)
tree377384baa19b78c6cb6b9e59f6a859a66b231ae0 /src/imports/platform/qquickplatformcolordialog_p.h
parent2e09e597ab3df5a13f89e945a0a90724d5c5a3f0 (diff)
ColorDialog: replace colorSelected() with a declarative property
This is consistent with the QML ColorDialog from QtQuick Dialogs 1. Change-Id: I4068a98156494eb36b2d9ecf4c1af90ad173bb97 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/platform/qquickplatformcolordialog_p.h')
-rw-r--r--src/imports/platform/qquickplatformcolordialog_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/imports/platform/qquickplatformcolordialog_p.h b/src/imports/platform/qquickplatformcolordialog_p.h
index 403582e4..70d913e1 100644
--- a/src/imports/platform/qquickplatformcolordialog_p.h
+++ b/src/imports/platform/qquickplatformcolordialog_p.h
@@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE
class QQuickPlatformColorDialog : public QQuickPlatformDialog
{
Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged FINAL)
Q_PROPERTY(QColorDialogOptions::ColorDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
Q_FLAGS(QColorDialogOptions::ColorDialogOptions)
@@ -64,6 +65,9 @@ class QQuickPlatformColorDialog : public QQuickPlatformDialog
public:
explicit QQuickPlatformColorDialog(QObject *parent = nullptr);
+ QColor color() const;
+ void setColor(const QColor &color);
+
QColor currentColor() const;
void setCurrentColor(const QColor &color);
@@ -71,15 +75,17 @@ public:
void setOptions(QColorDialogOptions::ColorDialogOptions options);
Q_SIGNALS:
- void optionsChanged();
+ void colorChanged();
void currentColorChanged();
- void colorSelected(const QColor &color);
+ void optionsChanged();
protected:
QPlatformDialogHelper *createHelper() override;
void applyOptions() override;
+ void accept() override;
private:
+ QColor m_color;
QSharedPointer<QColorDialogOptions> m_options;
};