diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-08-23 15:14:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-17 07:36:09 +0200 |
commit | e73d503b84be12e7bf28491356b459ca309e7c95 (patch) | |
tree | 854ded45f1d75032b5cc3feb78600acc5483f1f2 /src/imports/dialogs/qquickabstractcolordialog.cpp | |
parent | 77ee9ab37e81b4e593dec73428d584013d6e8574 (diff) |
Add currentColor property to ColorDialog.
QColorDialog has this property. This patch effectively means that
the color property will be set when the dialog closes, instead of
whenever the current color in the dialog changes, so pressing cancel
will revert the color to what it was before the dialog was opened.
[ChangeLog][QtDeclarative][ColorDialog] Added currentColor property.
Change-Id: I2ef6b32954342cd2469cf1552d53f9e2fbf3420b
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/imports/dialogs/qquickabstractcolordialog.cpp')
-rw-r--r-- | src/imports/dialogs/qquickabstractcolordialog.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/imports/dialogs/qquickabstractcolordialog.cpp b/src/imports/dialogs/qquickabstractcolordialog.cpp index d565352af6..abac997ca6 100644 --- a/src/imports/dialogs/qquickabstractcolordialog.cpp +++ b/src/imports/dialogs/qquickabstractcolordialog.cpp @@ -109,6 +109,15 @@ void QQuickAbstractColorDialog::setColor(QColor arg) m_color = arg; emit colorChanged(); } + setCurrentColor(arg); +} + +void QQuickAbstractColorDialog::setCurrentColor(QColor currentColor) +{ + if (m_currentColor != currentColor) { + m_currentColor = currentColor; + emit currentColorChanged(); + } } void QQuickAbstractColorDialog::setShowAlphaChannel(bool arg) |