summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenubar.mm
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-181-1/+1
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbintegration.cpp Change-Id: I2d71d06a55f730df19ace0dd3304238584a0497f
| * Cocoa QPA Menus: Propagate enabled state downwardsGabriel de Dietrich2016-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NSMenu has autoenableItems set to true by default, and we keep it this way in Qt. This means that NSMenuItem's enabled property is basically ignored and therefore QCocoaMenuItem::syncModalState() is wrong. What is also wrong, is syncModalState()'s name in both QCocoaMenuItem and QCocoaMenu. Indeed, this function's role should be to ensure that the enabled state is properly propagated down the menu hierarchy, whether the reason is being in the context of a modal dialog or the parent menu having been disabled by the app. Notice that the latter case is specially needed when a menubar menu is explicitly disabled. Therefore, we introduce a separate flag for the parent enabled state in order to avoid polluting the app-set enabled state flag. This is done in both QCocoaMenu and QCocoaMenuItem. In the case of QCocoaMenuItem, these two flags define whether an NSMenuItem is enabled state conjointly, and set from -[QCocoaMenuDelegate validateMenuItem:]. The rest of the logic remains as before. Similar logic is used in QCocoaMenu::isEnabled(). In addition, the presence of the second flag allows us to show disabled submenus in the same fashion native Cocoa applications do. This means, the submenu item itself remains enabled, allowing to show the submenu popup where all its menu items will appear disabled. Bonus change: merged all the bool flags into a bitfield and made the compiler happy about the ivar reordering in QCocoaMenu and QCocoaMenuItem's constructor. Task-number: QTBUG-54698 Task-number: QTBUG-55121 Change-Id: Ie156cb3aa57a519103908ad4605f7b43c57e5aef Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-3/+5
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| * QCocoaMenuBar: Sync items only when they are attached to a menuGabriel de Dietrich2016-07-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Another one of Cocoa's capricious behaviors. Evidence shows that the menu item's submenu property needs to be set before we can set the item's hidden property. We ensure this is the case by getting the NSMenuItem through QCocoaMenu::attachedItem() instead of QCocoaMenuBar::nativeItemForMenu() in QCocoaMenuBar::syncMenu(). Change-Id: Id50356dae5f556fa3d745ba9a5982e5a72bf0ac2 Task-number: QTBUG-54637 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Jason Haslam <jason@scitools.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| * QCocoaMenuBar: set the native item's titleGabriel de Dietrich2016-05-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Or, "Give Cocoa a Chance to do its Magic" Some menubar items, like the "Edit" menu, get extra items added at some point by Cocoa. Evidence points out to those extra items being added right after the NSMenu holding the menubar is set as the current menubar. At that point, both the child NSMenu and its NSMenuItem (the entry in the menubar) must have their title set. Therefore, we must set the menubar native item's title before QCocoaMenuBar::updateMenuBarImmediately() sets the main menu. Task-number: QTBUG-53085 Change-Id: Idd775cf0e3485739f38363a84cfed8d2db9cb662 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Marko Kangas <marko.kangas@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Simon Hausmann2016-03-231-1/+1
|\| | | | | | | Change-Id: I9a10e1f3c9506ec8554d8f59b6300825ac730939
| * QCocoaMenus: Use mix-in pattern to implement menu hierarchyGabriel de Dietrich2016-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To solve menu item roles from their text, we need to find its depth in the menubar hierarchy. Unfortunately, there's no trivial way to access that hierarchy from the QPA side, so we need to come with an ad-hoc solution. Previously, we were using a dynamic proprety to keep track of the 'parent' object. However, as the life span of the different objects has changed since 09acf326dbc6b7b67f21a36, we need a way to keep track of the parent's existence. This is what we do in this patch by having both QCocoaMenu and QCocoaMenuItem also inherit QCocoaMenuObject. This class' sole role is to store the menu hierarchy's parent object and wrap it in a QPointer. Change-Id: Ia18d95171af76d26f6325eef04c77b40d99c4285 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-53/+62
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QCocoaMenu: Decouple NSMenuItem from NSMenuGabriel de Dietrich2016-03-161-53/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While Cocoa requires an NSMenu to be coupled to an NSMenuItem (just as Qt requires a QMenu to be coupled to a QAction), making that a hard coupling comes with some limitations. This is because Cocoa won't allow the NSMenu object to be simultaneously coupled to more than one NSMenuItem and, similarly, an NSMenuItem can only be added to a single parent NSMenu. Therefore, it becomes difficult to share one QMenu between two different QMenuBars in different windows, or to use a QMenu as context menu while being accessible from the menu bar. Previous solutions to circumvent those limitations were less than ideal (see 119882714f87ffeb6945fdb2d02997ae125ff50c for the QMenuBar shared QMenu issue). Other workarounds that relied on that hard coupling, like 996054f5e65bc676aaea0743c2eacec51918e4aa, also added gratuitous complexity. In this patch, we break that hard NSMenuItem-NSMenu coupling, and we replace it with a temporary, looser coupling. As a consequence, * QCocoaMenu only contains and manages a NSMenu instance, removing the previously used NSMenuItem. It gets a temporarily attached NSMenuItem instead. * QCocoaMenuItem gains a safe pointer to its QCocoaMenu property removing the necessity containingMenuItem() in QCocoaMenu. * QCocoaMenuBar manages its own NSMenuItems. With this setup, we bind the NSMenu to its parent NSMenuItem at the last moment. In QCocoaMenuBar, when we call updateMenuBarImmediately(). In QCocoaMenu, we use the delegate's -[QCocoaMenuDelegate menu: updateItem:atIndex:shouldCancel:] method which is called when Cocoa is about to display the NSMenu. Note: There's still one use case we don't support, which is sharing a toplevel QMenuBar menu. This is because Cocoa's menu bar requires each of its menu items to have a submenu assigned, and therefore we can't rely on that last moment assignment. Task-number: QTBUG-34160 Task-number: QTBUG-31342 Task-number: QTBUG-41587 Change-Id: I92bdb444c680789c78e43fe0b585dc6661770281 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-13/+19
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Link to AppKit instead of Cocoa.Jake Petroules2015-09-051-1/+1
|/ | | | | | | | | | | | | Cocoa is basically just AppKit + CoreData. Since we do not use CoreData in Qt, there is no reason to link to it or (transitively) import its headers. This is just a mechanical replacement of -framework Cocoa with -framework AppKit and <Cocoa/Cocoa.h> with <AppKit/AppKit.h> Change-Id: Ibcfc8a03c0ddff27a67fbc87dd7bd58a4b648956 Reviewed-by: Mika Lindqvist <postmaster@raasu.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Add shared implementation of a NSAutoreleasePool wrapper to qglobalTor Arne Vestbø2015-05-271-5/+4
| | | | | | | | | | | We have at least 5 different (but equal) implementations of a wrapper in Qt, and some code uses explicit NSAutoreleasePools. Having a shared implementation lets us clean up things a bit and makes it easier to reason about which pools are actually needed. Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cocoa integration - menus and Qt::Tool windowsTimur Pocheptsov2015-03-271-2/+16
| | | | | | | | | | | | | | If an app has only Qt::Tool window(s) at start, menu is not updated, since Qt::Tool is also a Qt::Popup (included) and we have a special logic for Qt::Popup in QCocoaMenuBar::updateMenuBarImmediately. Using QCocoaApplicationDelegate (ivar 'inLaunch') we can avoid this problem. Change-Id: Ie1c4ef241cd19fa0af93c54de2b36e6e932cb77c Task-number: QTBUG-32539 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Fixed compilation on Mac OS X (qt namespace and preprocessor issues))Sergei Kulik2015-03-201-0/+4
| | | | | | | | 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>
* OSX: fix leaks due to missing NSAutoreleasePoolErik Verbruggen2015-02-261-0/+2
| | | | | | | env OBJC_DEBUG_MISSING_POOLS=YES qtcreator Change-Id: Ibbe5f42af5b94a439be3f0dd0f2b6e34bb1afd3f Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-21/+13
| | | | | | | | | | | | | | | | | | 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: Keep menu invisible when adding it to a menubarDaiwei Li2015-02-031-1/+3
| | | | | | | | | | | In MenuBar.qml, it's possible for __isNative to be set after visible on a child QQuickMenu. In that case, the qcocoamenu.mm will have set submenu to nil, only to be overridden in insertNativeMenu when __isNative is set. Change-Id: Id3c6bca03f937528d05b166cbd6a6d1011db43e8 Task-number: QTBUG-44168 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Cocoa: Force menubar update after inserting a new menuGabriel de Dietrich2014-04-161-0/+2
| | | | | | | | Task-number: QTBUG-38135 Change-Id: I7bb9f41789cc77c26a9623d69c28e3ad1607bb9c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* OSX: add several menuitem roles to support menu shortcuts in dialogsShawn Rutledge2014-04-071-0/+63
| | | | | | | | | | | | | | | | | | | | | Now menu items and key shortcuts for Cut, Copy, Paste and Select All work in the standard ways in dialogs such as the file dialog, provided that the corresponding QActions have been created and added to the menu. This depends on new roles to identify each menu item which is so broadly applicable that it should work even when a native widget has focus; but the role will be auto-detected, just as we were already doing for application menu items such as Quit, About and Preferences. When the QFileDialog is opened, it will call redirectKnownMenuItemsToFirstResponder() which will make only those "special" menu items have the standard actions and nil targets. When the dialog is dismissed, those NSMenuItems must be reverted by calling resetKnownMenuItemsToQt(), because to invoke a QAction, the NSMenuItem's action should be itemFired and the target should be the QCocoaMenuDelegate. Task-number: QTBUG-17291 Change-Id: I501375ca6fa13fac75d4b4fdcede993ec2329cc7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Delete the children before updating the Cocoa menubarAndy Shaw2014-02-121-0/+4
| | | | | | | | | | | | When the Cocoa menubar is updated then it ensures that the merged native menu items are visible if appropriate. However when the old menubar is deleted then it causes the merged native items to be hidden. Therefore we ensure the children are deleted first which causes the native items to be hidden and then update the menubar so that they can be correctly visible if they should be. Change-Id: I426864a5d2ec1f34c03290ac66371b12bf77cc00 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix crash regression for ApplicationWindow on MacJens Bache-Wiig2013-11-211-0/+1
| | | | | | | | | | | | | | | This fixes a recent regression following the integration of change: 7cc1656fef21e6bdc044968a79f0a41155357c29 (Make sure menu bar has a parent window ...) As it now consistently crashes on mac in several of the Qt Quick Controls examples, it is critical that it gets into the release branch. Change-Id: If3db1025229a7f7fd4e7ecc703d5f655db73964d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-141-8/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * Cocoa: Allow to hide menu items in menubarGabriel de Dietrich2013-08-131-8/+10
| | | | | | | | | | | | | | Task-number: QTBUG-32899 Change-Id: I423ac2d636306303d39e973f19032c9004957095 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Merge branch 'stable' into devSergio Ahumada2013-07-111-0/+5
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Cocoa: Don't update the menubar when popups are shownGabriel de Dietrich2013-06-271-0/+5
| | | | | | | | | | | | | | | | Task-number: QTBUG-31532 Change-Id: I86084cb96bd1dd253b3e2e4413c06de053b95b3b Reviewed-by: Romain Perier <romain.perier@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-121-21/+47
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenubar.mm Change-Id: I4a699fc8a7f30b2af9de8e496c3d5f027b7495bb
| * Cocoa:Fixed crash when sharing QMenu between two QMenuBar instancesRomain Perier2013-06-071-21/+47
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-041-0/+11
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/plugins/platforms/cocoa/qnsview.mm Change-Id: I6fe345df5c417cb7a55a3f91285d9b47a22c04fa
| * Cocoa: Hide empty menus from the menubarGabriel de Dietrich2013-05-301-0/+11
| | | | | | | | | | | | | | | | Task-number: QTBUG-31378 Change-Id: I33ab2979a26166fb07e836c85dfc8089af5e1fda Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.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>
* Cocoa: Improve text heuristic menu item syncing logicGabriel de Dietrich2013-04-251-1/+4
| | | | | | | | | | | | | | | 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>
* Add autorelease pools needed by Qt Creator.Morten Johan Sørvig2013-04-151-0/+2
| | | | | | | | With these Qt Creator startup is now warning-free on 10.6. Change-Id: Ie29d360611c0e516258920163e4e94d174217299 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* qcocamenubar: force update after destructorFawzi Mohamed2013-02-281-1/+3
| | | | | | Task-number: QTCREATORBUG-8785 Change-Id: I1e782cab36f4fea331561f016ea67a73deb63c37 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Rename all QWindow properties that have "window" in themShawn Rutledge2012-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | windowTitle, windowModality, windowIcon and so on are named that way to be similar to the ones in QWidget. However QQuickWindow inherits all of the declared properties, and we would like to have shorter property names in QML. If you are working with a Window then it's obvious the title property is the window title. Unfortunately, there must be patches in many other modules which depend on this one. In order to avoid the need to merge them all at the same time, there is also patch https://codereview.qt-project.org/#change,39001 which temporarily adds backwards-compatible accessors, which can be removed after the other modules are able to build without them. We should not rename windowState to state, because in QML, state usually drives the state machine for animation transitions etc. (although QWindow is not an Item, a user might get confused about it). Related patches are https://codereview.qt-project.org/#change,39001 https://codereview.qt-project.org/#change,37764 https://codereview.qt-project.org/#change,37765 https://codereview.qt-project.org/#change,37766 https://codereview.qt-project.org/#change,37762 Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change Q_ASSERT to warnings and returns for the menu classesAndy Shaw2012-10-031-3/+12
| | | | | | | | | | | 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>
* CocoaPlugin: add missing auto release poolsRichard Moe Gustavsen2012-09-121-0/+1
| | | | | | | | | | Add auto release pools to the entry functions of the plugin that leads to mem leaks. By adding them as early as possible in the callstack, we avoid creating to many pools Change-Id: I715e06bd8d3280c6877340fc724eb1afbf804ae1 Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Minor QPlatformMenu API cleanup.Morten Johan Sorvig2012-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Make the QPlatformMenu* classes abstract with pure virtual functions. Delete qplatformmenu_qpa.cpp. QtGui no longer has to carry the empty implementations. Change the inheritance tree - Make QPlatformMenu and QPlatformMenuBar inherit QObject instead of QMenuItem. Add (now) missing virtual functions to QPlatformMenu. The effect of this change is to reduce the number of pure virtuals the platform has to implement. Change QPlatformMenuBar::syncMenu to take a QPlatformMenu pointer instead of a QPlatformMenuItem* pointer. Fix a couple of header/unused variable compiler warnings. Change-Id: I77450e40c6aae26f3e1aca204603acebd242c036 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Cocoa implementation of QPA menu interface.James Turner2012-05-191-0/+254
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>