summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenuitem.mm
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa: Let Cocoa pick the right pixmap for menu item iconsGabriel de Dietrich2013-07-011-1/+2
| | | | | | | | | Task-number: QTBUG-31477 Change-Id: Iac2d13b68d36c691b60685b69cd390958c35fae3 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Cocoa: Allow delayed title setting in menu itemsGabriel de Dietrich2013-05-301-2/+3
| | | | | | | | | | | This is what happens in uic generated code. Therefore, we should not mark an item as text-synced until it's got its text set. Task-number: QTBUG-31378 Change-Id: I7bb7db8abad922b50546c7669d285369ebf01394 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Cocoa: Improve text heuristic menu item syncing logicGabriel de Dietrich2013-04-251-2/+21
| | | | | | | | | | | | | | | 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: Reflect menu hierarchy in QCocoaMenu* objectsGabriel de Dietrich2013-04-251-0/+3
| | | | | | | | | | | | | | QCocoaMenu is child of either a QCocoaMenuBar, a QCocoaMenuItem as a submenu, or nothing as a standalone menu. QCocoaMenuItem is child of its containing QCocoaMenu. The parent is set during insertion and cleared during removal. QMenu needs to be updated to avoid double deletion and leaking its own platform menu. Change-Id: Iadf60d8062d7466fa616f84f3761fe322fc9aa2e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: Remove dead code in QCocoaMenu*Gabriel de Dietrich2013-04-251-15/+2
| | | | | Change-Id: I56136594f073295ced645d06f657187a54e84384 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Move Mac translations to .cpp file for lupdate to pick them up.Friedemann Kleint2013-04-231-15/+12
| | | | | | | | 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>
* Cocoa Menu: Remove unnecessary retain, release/retain in the right orderGabriel de Dietrich2013-04-181-5/+2
| | | | | | | Also, make sure platform menu item is deleted on ActionRemoved event. Change-Id: Ic07a81cb77833bdffd1464abf1c81ebdee4d16e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* If the menu item is merged then we should not release itAndy Shaw2013-04-031-2/+2
| | | | | | | | | | When a menu item is merged then we do not want to release it as it will cause a problem with the Application menu. Therefore we just hide it instead. Change-Id: Ia9f7acfe063001111769841c9a360cac369f7ed7 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix duplicated application menu items on Mac OSChris Meyer2013-03-201-1/+1
| | | | | | | | | 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>
* Cocoa: Compile with Qt in a namespace.Morten Johan Sørvig2013-02-231-1/+4
| | | | | | | Task-number: QTBUG-29710 Change-Id: I28a4c213b78723aa369c7e00167401ec643155e6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix syncing of visibility and enabled for menus on CocoaAndy Shaw2012-10-261-1/+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 Q_ASSERT to warnings and returns for the menu classesAndy Shaw2012-10-031-1/+4
| | | | | | | | | | | On Mac usually release frameworks are used during development so asserts don't tend to get fired. Since the menu code did not crash in Qt 4.8, it was decided that we should ensure that the same code does not crash now so instead we warn instead of asserting for those cases. Change-Id: I923e5591202cb2ad801074ce3ad2a11d7190cee8 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-23/+23
| | | | | | | | 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>
* Convert QPA menus to use QIcon, and enable icons.James Turner2012-06-271-2/+3
| | | | | | | | | Icon support was disabled in QPA menus, now QIcon is in QtGui, convert the QPA interface, enable setting the icon in QMenu, and make the Cocoa implementation use it. (And fix a ref-counting leak if an icon is actually set) Change-Id: Ica203bf6826b79d8beee58f39febc851b9633a66 Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix Mac menu-merging case-sensitivity.James Turner2012-06-111-9/+11
| | | | | | | | Use case-insensitive string comparisons to deal with any combination of case in the target or menu text correctly. Fixes issues reported by BHughes in TextEdit and Creator. Change-Id: Ic3b577bf9034659b2de4aa206757b3a5a303a7b8 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Cocoa implementation of QPA menu interface.James Turner2012-05-191-0/+358
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>