summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert Mac event loop changes.Morten Johan Sørvig2013-09-021-1/+3
| | | | | | | | | | | | | | | "Make QGuiApplication::exec() run within NSApplicationMain()" "Make Qt process native and timer events on Cocoa applications" "Cocoa: Fix QFontDialog, QColorDialog auto-tests" This reverts commits 1e14762b8d79118540bd09a84dd3e48f4f5e113e e4b2a0b4bab2a17a65fedafe9bae50af1fe019f6 df7944e7d7dd8b2bbccbd639eff0ab09745d6cc3 Change-Id: I80b65b5ee0297b090f807bd420664233dfc44f7b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QGuiApplication::exec() run within NSApplicationMain()Gabriel de Dietrich2013-08-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We follow the same pattern as for iOS and Windows ports, making sure the user's main() runs in a platform friendly environment. In this particular case, it means calling the user's main() during the call of NSApplicationMain(), and calling the user's main() function (renamed to qMain() as in Windows) after receiving NSApplicationDidFinishLaunchingNotification. In practice, this means that NSApp is running when qMain() is called, and therefore when QCoreApplication::exec() is called. For those command-line utilities running on QGuiApplication, or any deriving class, and that do not provide a bundle, we override the main bundle's dictionary and get NSApplicationMain() to run as usual. Added cocoa/cocoamain "subdir" to build libqtcocoamain.a (together with cocoa/cocoaplugin -- plugins/platforms/cocoa is made a subdirs project). This library is linked against all GUI Qt apps and provides the actual main() function. It also catches the launching NSApplication notifications, and calls the user's qMain() function. Note that this will happen in the same cases when the user's application will run with the Cocoa QPA plugin. Launch related code in QCocoaApplicationDelegate is moved to libqtcocoamain, QNSApplication is removed (but sendEvent: redirection still there), and code in QCocoaEventDispatcher dealing with calling [NSApp run] and related has been removed since it's become unreachable. ChangeLog: [Qt for Mac] Make QGuiApplication::exec() run within NSApplicationMain() Change-Id: I790e5138c29aac2e0215a9147d0148fece40ca22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Improve Qt-in-namespace implementation in the Cocoa platform pluginRomain Perier2013-05-161-0/+3
| | | | | | | | | | | | | Objective-C++ does not support namespaces. In order to make this work, we decorate each symbol with suffix using the macro QT_MANGLE_NAMESPACE. However, with such a technic each public symbol needs to be explicitly exported through this macro. The use of @compatibility_alias allows to define alias to use it automatically and transparently. Task-number: QTBUG-23946 Change-Id: Id521b8160bab126fda40a9d960277b1c04cc8b66 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Remove ifdefs for supporting Mac OS <= 10.5Tor Arne Vestbø2013-02-181-13/+0
| | | | | | | | Qt5 requires Mac OS 10.6, so we can remove checks such as if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 Change-Id: Iea21727a277291148704ecf9677ed0b68c24920f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Cocoa: re-enable getUrl: and appleEventQuit: AppleEvent handlersBradley T. Hughes2012-06-121-0/+1
| | | | | | | | | | | | | | | | | | | The getUrl: and appleEventQuit: handlers are only called if we register them with the NSAppleEventManager. The Cocoa documentation says the best place to do this is in the applicationWillFinishLaunching: delegate method, so add this method and move the code from qcocoaeventdispatcher.mm to there. Since QCocoaApplicationDelegate is only used when AA_MacPluginApplication is not set, we do not need to check again in the delegate code. Be sure to remove these event handlers when shutting down the application. For the getUrl: handler, send file open events when receiving this event. This restores Qt 4 behavior. Remove the qDebug() from the appleEventQuit: handler. Change-Id: Ibcbdd541695176e3d236366d4d541e4811882d6c Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: Remove unused QApplicationPrivate from QCocoaApplicationDelegateBradley T. Hughes2012-06-121-5/+0
| | | | | | | | | | To avoid a QtWidget dependency, we should use QGuiApplicationPrivate isntead, but instead of storing, we can use QGuiAppliationPrivate::instance() instead. Change-Id: If3f63fee804b7ad32fe8d612bf70c051b70f54c8 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cocoa: QMenu refactor.Morten Sorvig2011-09-071-0/+127
This change prepares for enabling native menus on OS X. Move code from src/widgets to cocoa: - qcocoaapplicaiton - qcocoaapplicaitondelegate - qcocoamenuloader - qcocoamenu - qmenu_mac - misc helpers to qcocoahelpers Create a QNSApplication and QCocoaApplicationDelegate at application startup. New Lighthouse API: - class QPlatformMenu - class QPlatformMenuBar - QPlatformIntegration::createPlatformMenu() - QPlatformIntegration::createPlatformMenuBar() Platforms that wants a native menu integration subclasses QPlatformMenu[|Bar] and implements the create function. The default implementation returns 0, which causes QMenu to use the standard Qt menus. This API is based on the current native menu abstraction that Mac, Wince and S60 uses in Qt 4. The main difference is that the platform classes are proper standalone classes and not #ifdeffed into QMenuPrivate. Change-Id: I3da41f80b0ae903a476937908b1f9b88014b7954 Reviewed-on: http://codereview.qt.nokia.com/4068 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>