From 8f912c5c0f3f89e6f3042c0a948ccd155e57e216 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Wed, 28 Sep 2011 09:52:15 +0200 Subject: Native file dialog support for Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New API: QPlatformDialogHelper to support native dialog on QPA. (Currently, It supports only file dialog.) * Modify QDialog* and QFileDialog* to support native dialog. * Add native file dialog support to cocoa platform plugin. Change-Id: I957f046748a27a33fd9f8af3c525feabd1b0f582 Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qplatformintegration_qpa.cpp | 12 ++++++++++++ src/gui/kernel/qplatformintegration_qpa.h | 4 ++++ 2 files changed, 16 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 97c2445529..605cc5de59 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -250,6 +250,18 @@ QPlatformMenuBar *QPlatformIntegration::createPlatformMenuBar(QMenuBar *menuBar) return 0; } +bool QPlatformIntegration::usePlatformNativeDialog(QDialog *dialog) const +{ + Q_UNUSED(dialog); + return false; +} + +QPlatformDialogHelper * QPlatformIntegration::createPlatformDialogHelper(QDialog *dialog) const +{ + Q_UNUSED(dialog); + return 0; +} + /*! Should be called by the implementation whenever a new screen is added. diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h index 0ccd9f96d3..6dd87495b4 100644 --- a/src/gui/kernel/qplatformintegration_qpa.h +++ b/src/gui/kernel/qplatformintegration_qpa.h @@ -68,6 +68,7 @@ class QMenuBar; class QPlatformMenu; class QPlatformMenuBar; class QPlatformAccessibility; +class QPlatformDialogHelper; class Q_GUI_EXPORT QPlatformIntegration { @@ -104,6 +105,9 @@ public: virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const; virtual QPlatformAccessibility *accessibility() const; + virtual bool usePlatformNativeDialog(QDialog *dialog = 0) const; + virtual QPlatformDialogHelper *createPlatformDialogHelper(QDialog *dialog = 0) const; + // Access native handles. The window handle is already available from Wid; virtual QPlatformNativeInterface *nativeInterface() const; -- cgit v1.2.3