summaryrefslogtreecommitdiff
path: root/src/controls/qquickmenu_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Menu: Separate dismiss and destroy actionsGabriel de Dietrich2015-03-271-0/+5
| | | | | | | | | | | | | | | | | | | | This avoids issues when the action is triggered from a Menu and the slot ends up processing pending events, effectively deleting an object while one of its QML signal handlers is being executed. The reason being that we used to call deleteLater() on the menu popup window while still in the mouse event handler. Now, we do the same thing in three separate steps. 1. Close/dismiss the menu popups, 2. trigger the action, and 3. delete the popups. This keeps the menu popups and their contents alive until we return from the action triggered handler. We also need to take care of manually destroying any popup we may create. Finally, the menu content creation in Menu.qml had to be tweaked since we shouldn't rely on the popup visibility anymore. Task-number: QTBUG-45182 Change-Id: I9f1155bbf74dd3353c6c4066a24abf1cd2c3a283 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* qquickmenu: add support for providing a target rect to __popup()Richard Moe Gustavsen2014-09-301-1/+1
| | | | | | | | | | | | | | | | | Using a target rect as menu location instead of a position has been supported in QPlatformMenu for a while. The reason for specifying a rect instead of a position is that then the OS can decide if the popup should be placed above or below the target rect so that it fits inside the screen. A typical example is when showing an edit menu around a text selection. If the selection (target rectangle) is far up on the screen, the popup (with arrow) will be placed below the selection instead of above, which is the normal. Change-Id: Ie6cd6a92f1d9ef480c1e455960021c7f18f86569 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Update license headers and add new license filesAntti Kokko2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I470909ba0980db33ab551790d619c59a35978590 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* QQuickMenu: add enum MenuType that reflects QPlatformMenu::MenuTypeRichard Moe Gustavsen2014-08-061-1/+5
| | | | | | | | | | | | On mobile platforms several different popup menu types exist. E.g on iOS, you have a special popup just for selecting text. A recent patch added to QtBase added a new enum to QPlatformMenu that lets UI controls select/hint which one to use. This patch adds the same enum to QQuickMenu so that we can control this from Controls as well. Change-Id: Ibf4bdc84577b5a6527021b1cb15578b56bb4a92e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Menu: Properly relay enabled state to QPA menu objectGabriel de Dietrich2014-06-061-0/+2
| | | | | | Task-number: QTBUG-39384 Change-Id: I1b71912b4f35ea0aa9e06667a5c0ecedec30f980 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Popup Window: Privately expose popup geometryGabriel de Dietrich2014-03-071-0/+4
| | | | | Change-Id: I28a8edd657f02cecbd0c31965bd4085429cf4537 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Menu: Don't create platform item for QQuickMenuItemContainersGabriel de Dietrich2013-12-171-1/+0
| | | | | | | | | | They don't have any QPA counterpart as they're just plain containers. This also removes that "Menu does not contain the item to be removed" warning on Mac. Task-Number: QTBUG-32197 Change-Id: I06e08817194c2e3ad3efd7ded193bfac9d3a1948 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* ComboBox: Make popup scrollableGabriel de Dietrich2013-09-191-1/+2
| | | | | | | | | | | | | | | | We factor out part the menu item container logic from Menu into ColumnMenuContent, which takes care of scrolling and mouse hovering, and selection. This makes possible to extend the menu items layout. The pop-over and pull-down look is specified by the menu style component by overriding the ScrollView style. The popup's maximum height is also specified by the menu style. The gallery example can finally use a font families combo box. Task-number: QTBUG-31568 Change-Id: I34a7278f476471c0eb51ef51dde3dd83e13002fe Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Menu: Enable mnemonic menu navigationGabriel de Dietrich2013-09-131-1/+3
| | | | | | | | | | | We also added a new mnemonic specific shortcut context matcher. This prevents two menu items with the same mnemonic but within different menus to be reported as ambiguous. Task-number: QTBUG-33030 ChangeLog: Added mnemonic navigation for menus Change-Id: I192c9aacba4d15851fe65bf9201251962fe976d5 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* MenuBar: Make sure invisible menus appear soGabriel de Dietrich2013-08-131-0/+2
| | | | | | | Task-number: QTBUG-32899 Change-Id: Id07baba90ff45ba420d563ce47ee58964d4e4d02 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix warning in qquickmenu_p.hCaroline Chao2013-05-031-1/+4
| | | | | | | | | | 'Warning: Property declaration __font has no READ accessor function or associated MEMBER variable. The property will be invalid.' Task-number: QTBUG-30988 Change-Id: I7530310d0da03ecd59bfe1cc3e221e776c17d4f7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Menu: Add __xOffset, __yOffset propertiesGabriel de Dietrich2013-04-301-0/+9
| | | | | | | | | | These are for tweaking the popup position according to the current style. First usage goes to ComboBox. Also prepares for proper support of 'small' and 'mini' style hints. Change-Id: I7bc682d5d82bf6fa7a36916a9d4c64dfb2bdb56e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Rename QtMenuXxx to QQuickMenuXxxJ-P Nurmi2013-04-151-0/+171
Change-Id: I89aa205686f0bdf2b267ad17a8ae0470c2f4751f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>