summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qdialog.cpp11
-rw-r--r--src/widgets/dialogs/qdialog_p.h2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp2
3 files changed, 7 insertions, 8 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index b0cc35340d..f3e0773eac 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -123,12 +123,12 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
return QPlatformDialogHelper::defaultStyleHint(hint);
}
-void QDialogPrivate::deleteNativeDialog()
+void QDialogPrivate::deletePlatformHelper()
{
- if (QPlatformDialogHelper *helper = platformHelper()) {
- helper->deleteNativeDialog();
- nativeDialogInUse = false;
- }
+ delete m_platformHelper;
+ m_platformHelper = 0;
+ m_platformHelperCreated = false;
+ nativeDialogInUse = false;
}
/*!
@@ -335,7 +335,6 @@ QDialog::~QDialog()
} QT_CATCH(...) {
// we're in the destructor - just swallow the exception
}
- d->deleteNativeDialog();
}
/*!
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 3b8a5edb0f..34d5c551fd 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -83,7 +83,7 @@ public:
QWindow *parentWindow() const;
bool setNativeDialogVisible(bool visible);
QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const;
- void deleteNativeDialog();
+ void deletePlatformHelper();
QPointer<QPushButton> mainDef;
Qt::Orientation orientation;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 15a85c98d9..057728e254 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1371,7 +1371,7 @@ void QFileDialog::setAcceptMode(QFileDialog::AcceptMode mode)
}
d->retranslateWindowTitle();
// we need to recreate the native dialog when changing the AcceptMode
- d->deleteNativeDialog();
+ d->deletePlatformHelper();
// clear WA_DontShowOnScreen so that d->canBeNativeDialog() doesn't return false incorrectly
setAttribute(Qt::WA_DontShowOnScreen, false);
}