diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-07-30 15:02:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-31 09:53:34 +0200 |
commit | 59170ef2f2bd58038bdefaaad26ce8f9e8ee1dfe (patch) | |
tree | 10f80cbe02a4177cc990b978505b6bbc035ed9a1 /src | |
parent | 09ed33677124a81117a10f1f5a47d7fae1ef22a8 (diff) |
QtQuick.Dialogs.ColorDialog: set current color in the QColorDialog
It was a missing feature to set the current color programmatically,
either before or after showing the dialog.
Task-number: QTBUG-32621
Change-Id: I62a811f7c36eaab5356c5924bf3447deca55ada3
Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/dialogs/qquickabstractcolordialog.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/imports/dialogs/qquickabstractcolordialog.cpp b/src/imports/dialogs/qquickabstractcolordialog.cpp index 7cfd7ea692..d565352af6 100644 --- a/src/imports/dialogs/qquickabstractcolordialog.cpp +++ b/src/imports/dialogs/qquickabstractcolordialog.cpp @@ -66,6 +66,8 @@ void QQuickAbstractColorDialog::setVisible(bool v) { if (helper() && v) { m_dlgHelper->setOptions(m_options); + // Due to the fact that QColorDialogOptions doesn't have currentColor... + m_dlgHelper->setCurrentColor(m_color); } QQuickAbstractDialog::setVisible(v); } @@ -100,6 +102,9 @@ void QQuickAbstractColorDialog::setTitle(const QString &t) void QQuickAbstractColorDialog::setColor(QColor arg) { + if (m_dlgHelper) + m_dlgHelper->setCurrentColor(arg); + // m_options->setCustomColor or setStandardColor don't make sense here if (m_color != arg) { m_color = arg; emit colorChanged(); |