summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsdialoghelpers.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-01-16 16:44:25 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-21 21:50:07 +0100
commit661c3701f4731283a3f1062e4a8c8c02fb01e3c6 (patch)
treee19ff5c570d6cb8f6b54bce0a25d46b696ac91df /src/plugins/platforms/windows/qwindowsdialoghelpers.h
parent92237b22ea80b043bfd441ecad89cd504965b50f (diff)
Fix Windows native file dialogs for use with QtQuick.
- Correct modality check. - Allow for properties to be set if there is no native dialog. - Make dialog thread for non-modal call back into dialog helper for exec(). - Introduce QWindowsFileDialogSharedData to contain data to be cached while no native dialog exists and to be updated by the change notifications of the IFileDialogEvent interface to avoid querying the dialog results after the dialog has closed. Reduce virtual methods of QWindowsNativeFileDialogBase accordingly. This also fixes a bug in the previous implementation causing the directory not to reported back since the native API would not return the directory after closing the dialog. - Support nonmodal native dialogs when constructed on a QQuickWindow. - Delete native dialogs after exec as QtQuick keeps the dialog instances around. Change-Id: Id1169d6657d9476afe12fb9909c36cbd03aa2a40 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.h')
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.h b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
index c656f72d6e..9ec93f1b4c 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.h
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
@@ -65,6 +65,7 @@ template <class BaseClass>
class QWindowsDialogHelperBase : public BaseClass
{
public:
+ ~QWindowsDialogHelperBase() { deleteNativeDialog(); }
virtual void exec();
virtual bool show(Qt::WindowFlags windowFlags,
@@ -73,12 +74,13 @@ public:
virtual void hide();
virtual QVariant styleHint(QPlatformDialogHelper::StyleHint) const;
- virtual bool supportsNonModalDialog() const { return true; }
+ virtual bool supportsNonModalDialog(const QWindow * /* parent */ = 0) const { return true; }
protected:
QWindowsDialogHelperBase();
- ~QWindowsDialogHelperBase();
QWindowsNativeDialogBase *nativeDialog() const;
+ inline bool hasNativeDialog() const { return m_nativeDialog; }
+ void deleteNativeDialog();
private:
virtual QWindowsNativeDialogBase *createNativeDialog() = 0;