summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
Commit message (Collapse)AuthorAgeFilesLines
* qpa: Remove QPlatformDialogHelper::deleteNativeDialog()Bradley T. Hughes2012-05-101-3/+1
| | | | | | | | | | | | | | | | This function isn't really needed. The QDialogPrivate destructor deletes the platform helper, so the QDialog destructor does not need to do it. Subclasses of QPlatformDialogHelper are now responsible for deleting any native resources they create. The one place in QFileDialog that needs to recreate the native dialog can simply recreate the helper. QDialogPrivate::deleteNativeDialog() now becomes QDialogPrivate::deletePlatformHelper(), which resets all state to allow the platform helper to be recreated. Change-Id: I58adfe8801e02e63b3cb4a9a3a0b8cb5b3c7b161 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qpa: Clean up QPlatformDialogHelper APIBradley T. Hughes2012-05-101-6/+6
| | | | | | | | | | Remove the _sys suffix from all members of QPlatformDialogHelper and its subclasses. The QPlatform* class prefix already implies that these methods are system specific, we don't need the method suffix as well. Change-Id: I5ad1f928fab3a989992951acc244915e7fa48d32 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QPA: Cleanup native dialog modal executionBradley T. Hughes2012-05-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the _q_platformRunNativeAppModalPanel() function, together with the launchNativeAppModalPanel() signal and emitLaunchNativeAppModalPanel() slot, which were previously used to run the modal loop inside the QDialog::exec() loop. This trick isn't necessary anymore, so remove the mechanism and code related to it. Rename QPlatformDialogHelper::platformNativeDialogModalHelp() to exec_sys(). This function is now responsible for both showing the native dialog and running the modal loop. QDialog:exec() now calls this function if a native dialog is in use (it does not call QEventLoop::exec() anymore). The dialogResultCode_sys() function was unused, so it has also been removed. This commit also removes some unused private slots that were left over from the port to QPA. Note that the comments in the Cocoa plugin are still valid and relevant, but this commit does not fix the scenarios mentioned. This will be done in a future commit. The Windows plugin needs minor changes. The QueuedConnections to accept() and reject() cause the deliver to come too late, resulting in crashes, hence the change to AutoConnection (which ends up being a DirectConnection). Change-Id: Ifc90325c945ca78737e60bf331929f03ecc52e0a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Support all modality types in QPlatformDialogHelperBradley T. Hughes2012-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modality is not a boolean property in Qt. There are 2 types: window modality and application modality. Native dialogs can support both of these types as well (e.g. on Cocoa, a window modal file dialog should be displayed as a Sheet). Remove the QPlatformDialogHelper::ShowFlags enum and instead pass a Qt::WindowModality parameter to QPlatformDialogHelper::show_sys(). The Windows implementation has been updated to check for Qt::ApplicationModal instead of the ShowModal flag (since only Qt::ApplicationModal dialogs are blocking). The Cocoa implementation has been updated to only use non-modal and application modal native color and font dialogs (which restores Qt 4 behavior). These are shared Cocoa panels that cannot be shown as sheets, however. If the programmer asks for window modal color/font dialogs, we use the Qt versions, not the native ones. The file dialog can be shown either as a Sheet (but we need to pass an NSWindow parent for it to work properly) or as an application modal dialog. This change has been tested on Mac OS X with tests/manual/windowmodality. Change-Id: I9064987433895c55f68aac979ef8e8207fb24bbe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add QCocoaColor- and FontDialogHelperChristoph Schleifenbaum2012-02-141-0/+82
Change-Id: Ie6e648e9e1f4ffbb34d73f9afdd6cc77e86bc3d1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>