diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-11-04 14:45:42 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-08 14:10:15 +0100 |
commit | f54411069cc2f587ea2fee9a4d9ae16a8dde648b (patch) | |
tree | cfb4bbdfba9ec43ab6e8e651a7899f62ab9704a0 /src/widgets/dialogs/qfontdialog.cpp | |
parent | 5e26608ae2d724f5e45d9e8667378bf7faf69d8c (diff) |
Widgets: Use QPlatformDialogHelper in QColorDialog/QFontDialog.
Change-Id: Ib9a2f19679c2d4c8583742a918d61c1a98403843
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/widgets/dialogs/qfontdialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qfontdialog.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp index 62338d8a3e..1b8a9137ac 100644 --- a/src/widgets/dialogs/qfontdialog.cpp +++ b/src/widgets/dialogs/qfontdialog.cpp @@ -983,20 +983,18 @@ void QFontDialog::setVisible(bool visible) { if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden) != visible) return; -#ifdef Q_WS_MAC Q_D(QFontDialog); - if (d->canBeNativeDialog()){ - if (d->setVisible_sys(visible)){ - d->nativeDialogInUse = true; - // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below - // updates the state correctly, but skips showing the non-native version: - setAttribute(Qt::WA_DontShowOnScreen, true); - } else { - d->nativeDialogInUse = false; - setAttribute(Qt::WA_DontShowOnScreen, false); - } + if (d->canBeNativeDialog()) + if (QPlatformDialogHelper *helper = d->platformHelper()) + d->nativeDialogInUse = helper->setVisible_sys(visible); + if (d->nativeDialogInUse) { + // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below + // updates the state correctly, but skips showing the non-native version: + setAttribute(Qt::WA_DontShowOnScreen, true); + } else { + d->nativeDialogInUse = false; + setAttribute(Qt::WA_DontShowOnScreen, false); } -#endif // Q_WS_MAC QDialog::setVisible(visible); } @@ -1028,7 +1026,6 @@ void QFontDialog::done(int result) d->memberToDisconnectOnClose.clear(); } -#ifdef Q_WS_MAC bool QFontDialogPrivate::canBeNativeDialog() { Q_Q(QFontDialog); @@ -1043,7 +1040,6 @@ bool QFontDialogPrivate::canBeNativeDialog() QLatin1String dynamicName(q->metaObject()->className()); return (staticName == dynamicName); } -#endif // Q_WS_MAC /*! \fn QFont QFontDialog::getFont(bool *ok, const QFont &initial, QWidget* parent, const char* name) |