summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenu.h
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa QPA plugin: Unlock full Q_DECL_OVERRIDE karmaGabriel de Dietrich2015-08-011-21/+21
| | | | | | Change-Id: I0f631c3b120d052ad552809d0aab9493e5b41a70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* QShortCut: Check whether the menu is QPA-disabledGabriel de Dietrich2015-03-111-0/+1
| | | | | | | | | | | | When climbing the menu hierarchy, it's sounder to check whether the actual QPA menu is enabled. This way we can trigger modifier-less shortcuts even in submenus. Task-number: QTBUG-38256 Task-number: QTBUG-42584 Change-Id: I13a27027306bce0f0732b05bf9469f3b77028f73 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-061-0/+5
|\ | | | | | | Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
| * QCocoaMenu: Keep a reference to the containing menu itemGabriel de Dietrich2014-09-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | This allows the menu to tell its containing item the menu got deleted. This removes the need to reset the COCOA_MENU_ANCESTOR property value, which would crash since QCocoaMenuItem::m_menu would be a dangling pointer. Task-number: QTBUG-41587 Change-Id: Ia3408ef85cf823bfddbc2c41d6534e43bf14ed29 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | cocoa: override new QPlatformMenu::popup() functionRichard Moe Gustavsen2014-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having two versions of popup, one that takes a point and one that takes a target rect, causes problems for client code if they use the 'target rect' version since not all platforms override that function. So this patch will change the remaining platform that override QPlatformmenu into using the new 'target rect' version. Calling the old version that takes a point will still work, since the base version will then convert the point into a zero-sized rect, and forward the call to the 'target rect' version instead. Change-Id: Icc8531d79270a4f24ec08b8ed95b18ed3db1ad4d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
|/ | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QPA: Adding API to support QWidgetAction on MacGabriel de Dietrich2014-04-171-0/+1
| | | | | | | | | Includes the Cocoa implementation. Task-number: QTBUG-19840 Change-Id: Id33bc8053b82116cf76ed591b6df823df3aef9bc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Allow to hide menu items in menubarGabriel de Dietrich2013-08-131-0/+3
| | | | | | | Task-number: QTBUG-32899 Change-Id: I423ac2d636306303d39e973f19032c9004957095 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Cocoa:Fixed crash when sharing QMenu between two QMenuBar instancesRomain Perier2013-06-071-0/+5
| | | | | | | | | | | Don't insert a NSMenuItem into a NSMenu if this one already belongs to another NSMenu, this is forbidden in the Cocoa framework and raises an Exception. The solution consists in tagging the menu as sharable and moving it from one menubar to another when the window gets focus. Task-number: QTBUG-31342 Change-Id: Ic3bfadd4704f363ac26122ae15547543a0f6d44d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Improve text heuristic menu item syncing logicGabriel de Dietrich2013-04-251-4/+1
| | | | | | | | | | | | | | | Don't try anything after the original syncing, particularly after changing the menu item's text. Also, don't try anything if the menu item cannot be linked up to a menubar (see QTBUG-30756). This latter point requires extra syncing after adding a menu in the menubar. Finally, to be able to find the menubar, we need to clean the code for moc's eyes. Task-number: QTBUG-30756 Task-number: QTBUG-30812 Change-Id: I88fad663f1c35d03a0cb167d1723d16f590918c0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Remove dead code in QCocoaMenu*Gabriel de Dietrich2013-04-251-2/+0
| | | | | Change-Id: I56136594f073295ced645d06f657187a54e84384 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Add enablers for Android port in QPlatformMenuEskil Abrahamsen Blomfeldt2013-02-051-0/+2
| | | | | | | We need a couple of functions here for the Android support. Change-Id: I50e27277d7e838e277d616dbd3af9be817fb7197 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPA, Cocoa: Add platform popup menusGabriel de Dietrich2013-01-111-1/+5
|/ | | | | | | | Also, allow to set menu-wide font (instead of per menu item), and minimum width. Change-Id: I5f83f260602f55b9409ad69abf670afb59b2d33a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix syncing of visibility and enabled for menus on CocoaAndy Shaw2012-10-261-0/+1
| | | | | | | | | | | Fixed menu handling on Cocoa so if a menu is enabled/disabled or made visible or not then it will keep this in sync with the appropriate native menu entry. Change-Id: If269185fcf065fb1b2f60d6ef8c27c107eb4509f Reviewed-by: Pasi Matilainen <pasi.matilainen@digia.com> Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@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 missing cleanup of native Cocoa menus.James Turner2012-08-281-0/+1
| | | | | | | | | | | QCocoaMenu was missing a destructor to release various native resources, and this causes issues with pop-up menus when the Qt peers are recycled on successive shows of the same menu. Task-number: QTBUG-27022 Change-Id: I3cdf979804358ce10fe8a87c9e2c90419c6e0b48 Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Cocoa implementation of QPA menu interface.James Turner2012-05-191-36/+61
| | | | | | | | | | | 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>
* Cocoa: QMenu refactor.Morten Sorvig2011-09-071-0/+80
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>