summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenuloader.mm
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Fix leak of application menu NSMenuItemTor Arne Vestbø2023-04-291-2/+2
| | | | | | | Pick-to: 6.5 6.2 Fixes: QTBUG-112697 Change-Id: I0fe62e5a66f57bb9b8c073e636be346e088e0986 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: create application menu as QCocoaNSMenu with delegateVolker Hilsheimer2022-05-261-1/+1
| | | | | | | | | | | | This way we can handle keyboard shortcuts for actions in that menu as well in our menuHasKeyEquivalent implementation. This allows the focus widget to accept the override, and e.g. a QKeySequenceEdit to record Cmd+Q which with a plain NSMenu will just quit the application. Pick-to: 6.3 6.2 Fixes: QTBUG-103590 Change-Id: I84597307aef8f0ab65d97d78e5aa15e5cf2e707d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* macOS: don't block CMD+H while a popup is openVolker Hilsheimer2021-09-151-7/+2
| | | | | | | | | | | | | | | | | The shortcut hides the application, which works in native apps such as Xcode or Safari also while a popup menu (or combobox drop down) is open. This essentially reverts 29104c85db53e7c0c0aaf3fe78f84b737fce4886, which introduced the blocking of CMD+H to prevent the popup stack in the Cocoa plugin from going out of sync. With that stack gone after the previous commits, this is no longer a problem. Task-number: QTBUG-82626 Task-number: QTBUG-96450 Task-number: QTBUG-58727 Pick-to: 6.2 Change-Id: I35603d971741f03b793b7839b183b7ab37200647 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Cocoa: Allow CMD+H to hide the application when a tooltip is visibleAndy Shaw2020-11-101-1/+2
| | | | | | | | | | | Since native applications allow CMD+H to hide an application when the tooltip is visible then we should do too. Other popup windows will still block the call. Pick-to: 5.15 Fixes: QTBUG-82626 Change-Id: Ieac86d6b3cb2152a3ba82d8bd850f13bfeedb7c8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Clean up headersTor Arne Vestbø2020-06-051-0/+2
| | | | | | | | | | | | | | The headers are now C++ clean and can be used outside of Objective-C code. All includes of Objective-C frameworks have been moved to the implementation files. Header guards have been added in the few places they were missing. All includes are now done via #include, instead of sometimes using the #import variant. Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Move translations to their respective source filesTor Arne Vestbø2020-04-141-1/+0
| | | | | | | | | | lupdate can deal with Objective-C++ sources nowadays, most likely due to appending them to SOURCES instead of the deprecated OBJECTIVE_SOURCES. Task-number: QTBUG-30125 Change-Id: Ifc6b06f13e0f679a011d999f11c2e6d25dcf27ed Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCocoaMenuLoader: get rid of lastAppSpecificItemTimur Pocheptsov2019-08-081-21/+27
| | | | | | | | | | Look it up when needed instead. Also, simplify our ownership logic - do not retain/autorelease that is already owned by a menu (via its itemArray). Fixes: QTBUG-76523 Change-Id: I60a2ed0d192396baf99eec7b37fa5cc10e5db626 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Update all deprecated enums to their 10.12+ equivalentsTor Arne Vestbø2018-08-311-1/+1
| | | | | Change-Id: I3034258da95c9c70eb6758db92967f438617f6e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-18/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * QCocoaMenuLoader - ensure that ensureAppMenuInMenu indeed, ensuresGabriel de Dietrich2018-08-011-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic seems to be incorrect (or the naming is misleading): it only adds 'appMenu' if it was found in the previous 'mainMenu', failing otherwise. Consider the following example: while (true){ QApplication app(a,b); MainWindow w; w.show(); app.exec(); } It's quite a contrived but apparently allowed API use (OP claims they have to switch languages in their app). The main window and the app are destroyed, so is the menu bar. Then a new main window is created, with a new menu bar. Now the current [NSApp mainMenu] (the one set after we deleted the previous) does not have 'appMenu' anymore (we removed it when initializing the first menu bar). So as a result we have app menu missing and add new menus/items to a wrong menus/at wrong index. Change-Id: I64fce766d6c12ebf7ae12bb94af41c8c1de3d78b Task-number: QTBUG-69496 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Cocoa Menus: Clean up codeGabriel de Dietrich2018-04-261-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | In this edition: * Use Objective-C properties where appropriate. * Use recently introduced qt_objc_cast(). * Remove uses of foreach. * Update copyright headers. Change-Id: I2a07a7b6cab27b833e4deaeedf9563463ff55914 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | QCocoaNSMenuItem: Add default initializerGabriel de Dietrich2018-04-251-5/+4
| | | | | | | | | | | | | | Just tidying code a bit. Change-Id: I492535094533ee307d757bfbbcb41376291f8878 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Cocoa QPA: Clean up 0 as pointerGabriel de Dietrich2018-04-191-1/+1
| | | | | | | | | | | | | | | | We use nil for Objective-C null pointers and nullptr everywhere else, including CoreFoundation and similar opaque types. Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Cocoa Menus: Allow separators in app menuGabriel de Dietrich2018-04-191-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | We extend QCocoaNSMenuItem with separator items capabilities and use it as any other custom item in the app menu. Addition and removal of items in the app menu remains very basic because that menu doesn't exist as such. Instead, it's hinted through the QAction's menu role. Change-Id: Ia13bfcc008c75e49fd21705d2528da5a85ed1c73 Task-number: QTBUG-63756 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QCocoaMenuLoader: Add app specific items after PreferencesGabriel de Dietrich2018-04-191-6/+9
| | | | | | | | | | | | | | | | | | | | This is in accordance with the macOS HIG which state that, "in general, a Preferences menu item should be the first app-specific menu item." See https://developer.apple.com/macos/human-interface-guidelines/menus/menu-bar-menus/ Change-Id: Ie2b6ce274995a7d0b0e934c6a68241500a39f7aa Task-number: QTBUG-63756 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Cocoa Menus: Use the responder chain for menu items target/actionGabriel de Dietrich2018-04-191-66/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We start by setting the menu item target to nil. Then, -[qt_itemFired:] action is now in QNSView, which itself is naturally inserted in the responder chain. This removes the need to track and change the menu item's target/action when we're displaying a native dialog. Part of this is possible because we now derive our own QCocoaNSMenuItem class from NSMenuItem. We use -[respondsToSelector:] to decide whether the QNSView in the responder chain should respond to cut:, copy:, etc. And we only return YES when the view is first responder. The invocation to these action is forwarded to the same views' -[qt_itemFired:]. Message forwarding is done via forwardInvocation:, but experiments have shown that it can be done by the sole means of respondsToSelector: and direct invocation from cut:, copy:, etc. See the usage of the macro QT_COCOA_DYNAMIC_MENU_ITEM_ACTION. Menu validation also happens in QNSView and looks for modal windows. Therefore, -[worksWhenModal] is no longer necessary. Also, since the target is no longer set, the logic as documented in NSMenuItem.target won't work anymore. Most items from QCocoaMenuLoader also become QCocoaNSMenuItem and get the same target/action, which removes a bit of duplicated (and outdated) code. A particular case is the Quit item, which gets the terminate: action set until an actual menu item is added. Tested with texedit and standard dialogs examples together with menus, menurama and bigmenucreator manual tests. We also renamed some functions and variables to reflect common naming practices. Change-Id: I9b51d3be3467a666d8c3dcf8585edbc821e0282e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Clean up our Objective-C usageJake Petroules2018-02-201-4/+17
|/ | | | | | | | | | | | | | | | - Move ivars into @implementation - Use instancetype where applicable - Use dot notation for property access - Use subscript operator for dictionaries and arrays - Format selectors consistently - Use proper style for init methods - Use generics instead of void pointers where possible - Use "range for" loops instead of indexing - Replace or replace IBAction/IBOutlet with void Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-2/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * Cocoa: Disable “Hide” menu item on open popupsMorten Johan Sørvig2017-12-041-2/+6
| | | | | | | | | | | | | | | | | | Follow native behavior and disable ⌘H and the “Hide” menu item if there are any open popup windows. Task-number: QTBUG-58727 Change-Id: Iad38cc5cce29e0081613417c53b154ae0f05857e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Cocoa QPA: Delete singletons on exitGabriel de Dietrich2017-12-261-2/+6
|/ | | | | | | | | | This involves QCocoaApplicationDelegate and QCocoaMenuLoader. The former has been modernized to use blocks. The latter was not being deleted previously. Change-Id: Ic4cbfed2d9598fa04130675b3330d985b9489a21 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Cocoa QPA: Code clean up, make some bits more readableGabriel de Dietrich2017-10-241-13/+7
| | | | | | Change-Id: I7f37c1b0f7f72a79bb2ac5828ba54111a90a0a00 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QCFString::to(CF/NS/Q)String usage with QString methodsTor Arne Vestbø2016-10-061-7/+7
| | | | | | | | Slims down QCFString and leaves only one implementation of converting back and forth between CF/NS strings and QStrings. Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Make QCocoaMenuLoader a singletonGabriel de Dietrich2016-07-221-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | In some auto-tests, we create several instances of QGuiApplication (though seldom, if ever, simultaneously). However, the QCocoaMenuLoader instance was never properly deallocated, resulting in NSApplication.servicesMenu to still be assigned. This resulted in an exception being raised (NSInternalInconsistencyException) the second time we would construct a QCocoaMenuLoader. The CPU cycles saving solution is to make QCocoaMenuLoader a singleton. This approach is also safe since this class' initialization doesn't depend on any state in QGuiApplication (even the application name is fetched from either the main bundle or the app's args). This also allows us to clean up some code in QCocoaApplication and QCocoaApplicationDelegate who have suffered from lack of attention over the years. Change-Id: Ic4c859d628ab8abd9b469b99c64293582f8e363d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* QCocoaMenuLoader: Remove NIB fileGabriel de Dietrich2016-07-211-84/+103
| | | | | | | | | | | | | | | Since 10.6, the first menu is always identified as the application menu. See remark about Nibless apps and the application menu in, https://developer.apple.com/library/prerelease/content/releasenotes/AppKit/RN-AppKitOlderNotes/index.html Therefore, we can get rid of the NIB file together with the loading logic we had in place (and which, incidentaly, was using deprecated API). Change-Id: I99bf0e9d8ea749a9be9295fa12602335abc6548e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix for deferredDelete() bug when calling the glib loop directlyPaolo Angelelli2016-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure that all events posted using Qt on top of the GLib event loop have the loopLevel counter incremented. This is done since Qt depends on the fact that all deleteLater() calls are issued within the scope of some signal handler (in other words, triggered by the chain sendEvent() -> notifyInternal2()). There is a side effect though: in the conditions affected by this patch, that is deleteLater()s issued within a glib event handler for example, manually calling processEvents() or sendPostedEvents() with or without the QEvent::DeferredDelete flag has the same effect, and deferred deleted events are always processed. While this is not a currently working feature which the patch breaks, this side effect seems to be difficult to avoid without separating sendPostedEvents() and processEvents() into a public and a private method, in order to detect when they are manually called. Such change could perhaps be done for Qt6. An autotest for QTBUG-36434 is also included. Autotesting for QTBUG-32859 seems to be more challenging in this respect, due to its dependency on GLib. Task-number: QTBUG-18434 Task-number: QTBUG-32859 Task-number: QTBUG-36434 Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@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-22/+14
| | | | | | | | | | | | | | | | | | 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>
* qt_mac_loadMenuNib: Prevent stale NIB files by diffing file sizeTor Arne Vestbø2014-12-051-1/+5
| | | | | | | | | | | | | | | | | | | | | If we're changing the contents of the nib files in Qt, we need to overwrite the nib files that we write to /tmp, as QFile::copy() does not overwrite files. This also catches the case where the files in /tmp are empty due to a possible broken qrc-run, where re-runs of qrc to fix the resources would still leave the corrupt nib in /tmp, resulting in: -[NSKeyedUnarchiver initForReadingWithData:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver? And as a consequence: qt_mac_loadMenuNib: could not instantiate nib ASSERT: "mainMenu" in file qcocoamenuloader.mm, line 154 Change-Id: I2907a32d1a56c23a27343c81839a06b65a529372 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Cocoa: Adapt to Xcode 6 clang version sudden pickinessGabriel de Dietrich2014-06-031-1/+1
| | | | | | | Yes, that means OS X Yosemite fix. Change-Id: I236f7af7b803de24ff0895e04c9a9253b5cfdb3b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Mac: Use QString::toNSString in QtBase.Morten Johan Sørvig2014-04-031-2/+1
| | | | | | | | | | | The string is now autoreleased. This fixes a memory leak in qt_mac_QStringListToNSMutableArrayVoid Task-number: QTBUG-20347 Change-Id: I11ebeb264af4c8ce98968f2221eea772f24c12d4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Improve Qt-in-namespace implementation in the Cocoa platform pluginRomain Perier2013-05-161-2/+2
| | | | | | | | | | | | | 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>
* Increase the loopLevel when activating menu items.Morten Johan Sørvig2013-04-261-0/+3
| | | | | | | | | | | | | | | | | Apply 0293aff5c44202e5c62e229b74d8bd0bf9206185 from Qt 4. Without this, calls to deleteLater() may create delete later events with a loopLevel of 1. Those events will not be processed until QApplication::exec() returns. Add a QScopedLoopLevelCounter that increases the loopLevel for the duration of the activated() call. Task-number: QTBUG-30660 Change-Id: I7ab3bb3a53243691b8f7f64e025150e5cc7da2c8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Move Mac translations to .cpp file for lupdate to pick them up.Friedemann Kleint2013-04-231-24/+1
| | | | | | | | Task-number: QTBUG-30125 Change-Id: I4e56fd3021b4ef5f344d4d36ae594dd88e2aa1bd Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix duplicated application menu items on Mac OSChris Meyer2013-03-201-2/+8
| | | | | | | | | Added code to check to see if the menu item already exists in the application menu before adding it. Change-Id: Ie0a5eab3c61d5a3413a834d2e57bab40660f6802 Task-number: QTBUG-27202 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Doc: Fix module name formatSze Howe Koh2013-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@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>
* 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>
* Fix namespace compilation on OSX.Toby Tomkins2012-06-141-2/+2
| | | | | Change-Id: Ib579ae298a5f894b8b02a5d56567870109bd29bd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cocoa implementation of QPA menu interface.James Turner2012-05-191-27/+53
| | | | | | | | | | | 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>
* QPA menu abstraction, originally based on Morten's workJames Turner2012-05-191-3/+6
| | | | | | | | | | Create a QPA abstraction for native menus, derived from the Cocoa support in 4.8, but with the expectation to support other platforms too. Update the QtWidget QMenu and QMenuBar code to maintain their QPA equivalents if they exist. Change-Id: Id605de3da8811dc832bf48b35f9107778ad320ff Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fix incorrect state of show/hide menu items in Mac application menuPasi Matilainen2012-04-161-0/+12
| | | | | | | | | | | | The "Hide <app>", "Hide Others" and "Show All" menu items in Mac application menu are always enabled, and do not get disabled correctly. Fix by turning on autoenable for the menu in qt_menu.nib, and by implementing menu item validation in QCocoaMenuLoader. Task-number: QTBUG-10705 Change-Id: Ic181dfa26a71acad0067f5269c72517b50b17362 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> (cherry picked from commit 8f23a6be1069455e609e8bea7527726c24bebb36)
* Use "qt-project.org" instead of "trolltech" in the resource systemhjk2012-03-281-1/+1
| | | | | | | Task-number: QTBUG-23272 Change-Id: Idcdb9620910577b3c0fc9a792a0446665bd2eab6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a double-release when loading NIB filesJamie Kirkpatrick2012-02-291-1/+0
| | | | | Change-Id: I0c2c2a932b433a84e136da8e262739951a1d8c6e Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Move QString <-> NSString conversion to QtCoreMorten Johan Sorvig2012-02-021-8/+8
| | | | | | | | | | | | | | | | Add (private) API to QCFString: static QString toQString(NSString *) static NSString *toNSString(const QString &) Add implementation to qcore_mac_objc.mm. Keep the mac_cpp since it's used for building qmake as well as bootstrapping. Replace usage of NSString conversion functions in the cocoa and corewlan plugin with QCFString. Change-Id: I9f34edd5231255aef9d8d6e9a60306174bb279b3 Reviewed-by: Bradley T. Hughes <bradley.hughes@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>
* Clang Build Fix: Cocoa platform pluginTakumi ASAKI2011-09-091-1/+1
| | | | | | | | | | Fix some assignment from const values to non-const without cast. Move #import to avoid compile error. Fix type mismatch. Change-Id: I93ae5cd07827b92a91093df979992616b26b14af Reviewed-on: http://codereview.qt-project.org/4536 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>