summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaapplication.mm
Commit message (Collapse)AuthorAgeFilesLines
* Mangle QNSApplication and methods into a namespaceMelanie Cappelaere2015-07-141-10/+10
| | | | | | | | | | [OS X] Mangle the event handle related calls on QNSApplication, so that the events are passed through the correct QApplications when several Qt5's with different namespaces do UI in the same process. Change-Id: Ibb44246fbcf4a2bc3af5a93c48db0382a1380328 Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Cocoa: fix compiler warning.Erik Verbruggen2015-04-221-1/+1
| | | | | | | | | | /Users/erik/dev/qt5-stable/qtbase/src/plugins/platforms/cocoa/qcocoaapplication.mm:137:18: warning: case value not in enumerated type 'NSEventSubtype' [-Wswitch] case QtCocoaEventSubTypePostMessage: ^ Change-Id: Ib496e61a6939f021c90234fef3689b1643003ddd Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Fixed compilation on Mac OS X (qt namespace and preprocessor issues))Sergei Kulik2015-03-201-5/+5
| | | | | | | | Configured with -qtnamespace <...> -no-opengl -D QT_NO_PRINTER Change-Id: I1c959a89afda08d29a854f21e6e51732d136753c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-23/+15
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* cocoa: don't override NSApplication-sendEvent if configured as ↵Tim Blechmann2014-09-151-0/+10
| | | | | | | | AA_MacPluginApplication Change-Id: I48cebbcb814ee8e97583c3165e7cb668077cfbad Task-number: QTBUG-40409 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix compiler warning for cast from int to id.Erik Verbruggen2013-11-151-2/+2
| | | | | | | | | | | qcocoaapplication.mm:118:61: warning: cast to 'id' from smaller integer type 'int' [-Wint-to-pointer-cast] id a1 = ([args->arg1 isKindOfClass:[NSNumber class]]) ? (id)[args->arg1 intValue] : args->arg1; ^ qcocoaapplication.mm:119:61: warning: cast to 'id' from smaller integer type 'int' [-Wint-to-pointer-cast] id a2 = ([args->arg2 isKindOfClass:[NSNumber class]]) ? (id)[args->arg2 intValue] : args->arg2; Change-Id: Ibcf3d5d5698ff863f3c9bd65e0388ccca147f419 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Revert Mac event loop changes.Morten Johan Sørvig2013-09-021-15/+31
| | | | | | | | | | | | | | | "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-31/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+5
| | | | | | | | | | | | | 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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Support native event filter for Mac OS XLiang Qi2012-11-091-12/+16
| | | | | | | | | | | Ported from Qt 4 implementation, updated with QAbstractEventDispatcher::filterNativeEvent() call. Tested with an example. Change-Id: I3271f8a565d06d80b7b48ba81728bcdb7b1c32e3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-25/+25
| | | | | | | | 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: 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>
* Cocoa implementation of QPA menu interface.James Turner2012-05-191-11/+0
| | | | | | | | | | | Implement the QPA platform menu interface for Cocoa, including native menubar support and merging with the predefined menus created from the bundled .nib. Cleanup code previously used to maintain the menus, and add a manual test of the menus code. Change-Id: Ia99267ddb6485e18e05c540eb32c5aee6cbb85db 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>
* Add check to make sure qApp exists before usingChris Meyer2011-12-191-1/+1
| | | | | | | | | | Check for qApp before using. I'm aware that this is in commented out code right now; but I wanted to make sure it doesn't accidently slip back in without this check so I'm submitting this patch. It caused problems at shutdown in 4.8. Change-Id: I1c2358ab94f8b698e5519b3e0f988fb5cdd653fa Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: clean up compiler warnings.Morten Sorvig2011-10-231-0/+2
| | | | | Change-Id: I2cb65bb455b79b218a317b21e5a3b0d9792e0e22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: Fix spelling errors in comments.Morten Sorvig2011-10-031-1/+1
| | | | | | | | | | This could be the basis for a "english spelling for norwegians" course. Change-Id: I1d6de11b6673ec0a8ba3c2ff12dd8472fb467703 Reviewed-on: http://codereview.qt-project.org/5691 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: QMenu refactor.Morten Sorvig2011-09-071-0/+227
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>