summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsdialoghelpers.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-11-10 13:07:01 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-11 10:58:10 +0100
commitaf914694d81317b4a7bf0804d9d34a1f3bf2cf48 (patch)
tree039dc97541bc51cdeddf21b5f8949d5e998b18de /src/plugins/platforms/windows/qwindowsdialoghelpers.h
parent9a8a70d8e42f7e8fee8398affa5680adb2ba24d6 (diff)
QPlatformDialogHelper: Split class hierarchy, decouple from Dialog
- 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 <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.h')
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.h b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
index 8566f00d55..99f3c0b2d2 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.h
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
@@ -44,12 +44,14 @@
#ifdef QT_WIDGETS_LIB
+#include "qtwindows_additional.h"
#include <QtWidgets/qplatformdialoghelper_qpa.h>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
class QFileDialog;
+class QDialog;
class QWindowsNativeDialogBase;
namespace QWindowsDialogs
@@ -58,21 +60,25 @@ namespace QWindowsDialogs
Type dialogType(const QDialog *dialog);
void eatMouseMove();
+
+ bool useHelper(const QDialog *dialog);
+ QPlatformDialogHelper *createHelper(QDialog *dialog);
} // namespace QWindowsDialogs
-class QWindowsDialogHelperBase : public QPlatformDialogHelper
+template <class BaseClass>
+class QWindowsDialogHelperBase : public BaseClass
{
public:
- static bool useHelper(const QDialog *dialog);
- static QPlatformDialogHelper *create(QDialog *dialog);
virtual void platformNativeDialogModalHelp();
virtual void _q_platformRunNativeAppModalPanel();
virtual void deleteNativeDialog_sys();
- virtual bool setVisible_sys(bool visible);
- virtual QDialog::DialogCode dialogResultCode_sys();
+ virtual bool show_sys(QWindow *parent);
+ virtual void hide_sys();
+ virtual QVariant styleHint(QPlatformDialogHelper::StyleHint) const;
+
+ virtual QPlatformDialogHelper::DialogCode dialogResultCode_sys();
- virtual bool nonNativeDialog() const = 0;
virtual bool supportsNonModalDialog() const { return true; }
protected:
@@ -85,6 +91,7 @@ private:
QDialog *m_dialog;
QWindowsNativeDialogBase *m_nativeDialog;
+ HWND m_ownerWindow;
};
QT_END_NAMESPACE