From af914694d81317b4a7bf0804d9d34a1f3bf2cf48 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 10 Nov 2011 13:07:01 +0100 Subject: QPlatformDialogHelper: Split class hierarchy, decouple from Dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Introduce hierarchy of QPlatformDialogHelper-derived classes for font, color and file dialogs. - Start reducing dependencies on QDialog: * Remove QDialog-specifics from interface, introduce enumeration for DialogCode * Make the helpers Q_OBJECTS to be able to add the signals passed on to the QDialogs * Remove QDialogPrivate pointer - Split setVisible_sys() in show_sys() (factory method for native dialogs) and hide_sys(). Pass parent window to show_sys(), removing the necessity to query the QDialog for it - Introduce a styleHint() similar to QGuiApplication's for platform-specific - Fix compile in cocoa/windows, reduce depency on QDialog (-private) classes. Change-Id: Ic1cb715e1edf767f2cb18b9780341d189339ef1d Reviewed-by: Morten Johan Sørvig --- src/widgets/dialogs/qfiledialog.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/widgets/dialogs/qfiledialog.cpp') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 9b7c525c8b..75ba15af87 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -713,8 +713,7 @@ void QFileDialog::setVisible(bool visible) return; if (d->canBeNativeDialog()){ - if (d->setVisible_sys(visible)){ - d->nativeDialogInUse = true; + if (d->setNativeDialogVisible(visible)){ // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below // updates the state correctly, but skips showing the non-native version: setAttribute(Qt::WA_DontShowOnScreen); @@ -723,7 +722,6 @@ void QFileDialog::setVisible(bool visible) d->completer->setModel(0); #endif } else { - d->nativeDialogInUse = false; setAttribute(Qt::WA_DontShowOnScreen, false); #ifndef QT_NO_FSCOMPLETER if (d->proxyModel != 0) @@ -2268,7 +2266,7 @@ void QFileDialogPrivate::createWidgets() Q_Q(QFileDialog); model = new QFileSystemModel(q); model->setObjectName(QLatin1String("qt_filesystem_model")); - if (QPlatformDialogHelper *helper = platformHelper()) + if (QPlatformFileDialogHelper *helper = platformFileDialogHelper()) model->setNameFilterDisables(helper->defaultNameFilterDisables()); else model->setNameFilterDisables(false); -- cgit v1.2.3