diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-08-13 16:58:44 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-08-17 08:31:20 +0000 |
commit | efdd81ce80b018b7b5779876e94f1b722af7fb9a (patch) | |
tree | e1bf8151431f64f54707157b8f62823374e373bb /src/dialogs | |
parent | 22fab1502f562bccb3c16dde0288aa867e3b094a (diff) | |
download | qtquickcontrols-efdd81ce80b018b7b5779876e94f1b722af7fb9a.tar.gz |
Fix ColorDialog.color and FontDialog.font update on accept
When using native dialogs, ColorDialog.color was not updated at all,
and FontDialog.font was incorrectly following FontDialog.currentFont.
Promote the overridden accept() methods to the abstract base classes
so the native dialogs get the appropriate property updates on accept
the same way compared to the non-native dialogs.
Task-number: QTBUG-55298
Change-Id: I9ac8f5ecc60884cd98b58d09ef3dcb4baf47772d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/dialogs')
-rw-r--r-- | src/dialogs/qquickabstractcolordialog.cpp | 6 | ||||
-rw-r--r-- | src/dialogs/qquickabstractcolordialog_p.h | 3 | ||||
-rw-r--r-- | src/dialogs/qquickabstractfontdialog.cpp | 6 | ||||
-rw-r--r-- | src/dialogs/qquickabstractfontdialog_p.h | 3 | ||||
-rw-r--r-- | src/dialogs/qquickcolordialog.cpp | 6 | ||||
-rw-r--r-- | src/dialogs/qquickcolordialog_p.h | 3 | ||||
-rw-r--r-- | src/dialogs/qquickfontdialog.cpp | 6 | ||||
-rw-r--r-- | src/dialogs/qquickfontdialog_p.h | 3 | ||||
-rw-r--r-- | src/dialogs/qquickplatformfontdialog.cpp | 2 |
9 files changed, 19 insertions, 19 deletions
diff --git a/src/dialogs/qquickabstractcolordialog.cpp b/src/dialogs/qquickabstractcolordialog.cpp index 2101fe0e..44c203df 100644 --- a/src/dialogs/qquickabstractcolordialog.cpp +++ b/src/dialogs/qquickabstractcolordialog.cpp @@ -124,4 +124,10 @@ void QQuickAbstractColorDialog::setShowAlphaChannel(bool arg) emit showAlphaChannelChanged(); } +void QQuickAbstractColorDialog::accept() +{ + setColor(m_currentColor); + QQuickAbstractDialog::accept(); +} + QT_END_NAMESPACE diff --git a/src/dialogs/qquickabstractcolordialog_p.h b/src/dialogs/qquickabstractcolordialog_p.h index 99be766c..16b39c26 100644 --- a/src/dialogs/qquickabstractcolordialog_p.h +++ b/src/dialogs/qquickabstractcolordialog_p.h @@ -96,6 +96,9 @@ Q_SIGNALS: void currentColorChanged(); void selectionAccepted(); +protected Q_SLOTS: + virtual void accept(); + protected: QPlatformColorDialogHelper *m_dlgHelper; QSharedPointer<QColorDialogOptions> m_options; diff --git a/src/dialogs/qquickabstractfontdialog.cpp b/src/dialogs/qquickabstractfontdialog.cpp index fb715c35..0886449b 100644 --- a/src/dialogs/qquickabstractfontdialog.cpp +++ b/src/dialogs/qquickabstractfontdialog.cpp @@ -154,4 +154,10 @@ void QQuickAbstractFontDialog::setProportionalFonts(bool arg) emit proportionalFontsChanged(); } +void QQuickAbstractFontDialog::accept() +{ + setFont(m_currentFont); + QQuickAbstractDialog::accept(); +} + QT_END_NAMESPACE diff --git a/src/dialogs/qquickabstractfontdialog_p.h b/src/dialogs/qquickabstractfontdialog_p.h index 3162be2a..f60c4ddb 100644 --- a/src/dialogs/qquickabstractfontdialog_p.h +++ b/src/dialogs/qquickabstractfontdialog_p.h @@ -101,6 +101,9 @@ Q_SIGNALS: void currentFontChanged(); void selectionAccepted(); +protected Q_SLOTS: + virtual void accept(); + protected: QPlatformFontDialogHelper *m_dlgHelper; QSharedPointer<QFontDialogOptions> m_options; diff --git a/src/dialogs/qquickcolordialog.cpp b/src/dialogs/qquickcolordialog.cpp index 875c6740..686bd850 100644 --- a/src/dialogs/qquickcolordialog.cpp +++ b/src/dialogs/qquickcolordialog.cpp @@ -118,10 +118,4 @@ QQuickColorDialog::~QQuickColorDialog() \l Window or an \l Item. */ -void QQuickColorDialog::accept() -{ - setColor(m_currentColor); - QQuickAbstractColorDialog::accept(); -} - QT_END_NAMESPACE diff --git a/src/dialogs/qquickcolordialog_p.h b/src/dialogs/qquickcolordialog_p.h index d3c3463b..619b7b10 100644 --- a/src/dialogs/qquickcolordialog_p.h +++ b/src/dialogs/qquickcolordialog_p.h @@ -65,9 +65,6 @@ public: explicit QQuickColorDialog(QObject *parent = 0); ~QQuickColorDialog(); -protected Q_SLOTS: - virtual void accept(); - protected: virtual QPlatformColorDialogHelper *helper() { return 0; } diff --git a/src/dialogs/qquickfontdialog.cpp b/src/dialogs/qquickfontdialog.cpp index 0e27d29a..00acf238 100644 --- a/src/dialogs/qquickfontdialog.cpp +++ b/src/dialogs/qquickfontdialog.cpp @@ -119,10 +119,4 @@ QQuickFontDialog::~QQuickFontDialog() \l Window or an \l Item. */ -void QQuickFontDialog::accept() -{ - setFont(m_currentFont); - QQuickAbstractFontDialog::accept(); -} - QT_END_NAMESPACE diff --git a/src/dialogs/qquickfontdialog_p.h b/src/dialogs/qquickfontdialog_p.h index 71301a76..bd04f536 100644 --- a/src/dialogs/qquickfontdialog_p.h +++ b/src/dialogs/qquickfontdialog_p.h @@ -65,9 +65,6 @@ public: explicit QQuickFontDialog(QObject *parent = 0); ~QQuickFontDialog(); -protected Q_SLOTS: - virtual void accept(); - protected: virtual QPlatformFontDialogHelper *helper() { return 0; } diff --git a/src/dialogs/qquickplatformfontdialog.cpp b/src/dialogs/qquickplatformfontdialog.cpp index 247e869e..2c501a1c 100644 --- a/src/dialogs/qquickplatformfontdialog.cpp +++ b/src/dialogs/qquickplatformfontdialog.cpp @@ -170,7 +170,7 @@ QPlatformFontDialogHelper *QQuickPlatformFontDialog::helper() return m_dlgHelper; connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept())); connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject())); - connect(m_dlgHelper, SIGNAL(currentFontChanged(QFont)), this, SLOT(setFont(QFont))); + connect(m_dlgHelper, SIGNAL(currentFontChanged(QFont)), this, SLOT(setCurrentFont(QFont))); connect(m_dlgHelper, SIGNAL(fontSelected(QFont)), this, SLOT(setFont(QFont))); } |