diff options
Diffstat (limited to 'src/widgets/dialogs/qdialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qdialog.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 9410a9b62b..dbe5da8ed4 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -52,10 +52,10 @@ #include "qwhatsthis.h" #include "qmenu.h" #include "qcursor.h" -#include "qplatformtheme_qpa.h" +#include <qpa/qplatformtheme.h> #include "private/qdialog_p.h" #include "private/qguiapplication_p.h" -#include "qplatformtheme_qpa.h" +#include <qpa/qplatformtheme.h> #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif @@ -88,8 +88,6 @@ QPlatformDialogHelper *QDialogPrivate::platformHelper() const if (m_platformHelper) { QObject::connect(m_platformHelper, SIGNAL(accept()), dialog, SLOT(accept())); QObject::connect(m_platformHelper, SIGNAL(reject()), dialog, SLOT(reject())); - QObject::connect(m_platformHelper, SIGNAL(launchNativeAppModalPanel()), - dialog, SLOT(_q_platformRunNativeAppModalPanel())); ncThis->initHelper(m_platformHelper); } } @@ -118,13 +116,6 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible) return nativeDialogInUse; } -void QDialogPrivate::_q_platformRunNativeAppModalPanel() -{ - if (nativeDialogInUse) - platformHelper()->_q_platformRunNativeAppModalPanel(); -} - - QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const { if (const QPlatformDialogHelper *helper = platformHelper()) @@ -132,6 +123,14 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const return QPlatformDialogHelper::defaultStyleHint(hint); } +void QDialogPrivate::deleteNativeDialog() +{ + if (QPlatformDialogHelper *helper = platformHelper()) { + helper->deleteNativeDialog_sys(); + nativeDialogInUse = false; + } +} + /*! \class QDialog \brief The QDialog class is the base class of dialog windows. @@ -328,6 +327,7 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f) QDialog::~QDialog() { + Q_D(QDialog); QT_TRY { // Need to hide() here, as our (to-be) overridden hide() // will not be called in ~QWidget. @@ -335,6 +335,7 @@ QDialog::~QDialog() } QT_CATCH(...) { // we're in the destructor - just swallow the exception } + d->deleteNativeDialog(); } /*! @@ -525,13 +526,14 @@ int QDialog::exec() } show(); - if (d->nativeDialogInUse) - d->platformHelper()->platformNativeDialogModalHelp(); - - QEventLoop eventLoop; - d->eventLoop = &eventLoop; QPointer<QDialog> guard = this; - (void) eventLoop.exec(QEventLoop::DialogExec); + if (d->nativeDialogInUse) { + d->platformHelper()->exec_sys(); + } else { + QEventLoop eventLoop; + d->eventLoop = &eventLoop; + (void) eventLoop.exec(QEventLoop::DialogExec); + } if (guard.isNull()) return QDialog::Rejected; d->eventLoop = 0; |