aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenu.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into ↵v5.15.6-lts-lgplTarja Sundqvist2022-08-161-1/+0
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I85122ded86860165f2d9523e3ac15e129df1fa75
| * Revert "Allow creation of custom QQuickPopupItem-derived types"Mitch Curtis2021-08-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6b8a9673111bbf888990ce5904e176057ad4a71b. The follow-up commit a063cd0be5e8f108a0084831856f4af8c0e9159c causes QTBUG-94764, so we don't need this enabling change for now. Task-number: QTBUG-83630 Task-number: QTBUG-94764 Change-Id: I1aec8571dcdcc2103d0e56c3d0bbfc4a4872d8db (adapted from commit b69d071c10dfa4c5d7b62692b8a9d7bb659a4ab5) Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into ↵v5.15.5-lts-lgplTarja Sundqvist2022-05-191-2/+3
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Iec31024aafdb1785574ba6450ca754f4660c05ee
| * Don't call QQml_setParent_noEvent with a nullptr itemVolker Hilsheimer2021-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Since we check for item being nullptr just before it evidently can be, in which case QQml_setParent_noEvent would access that nullptr. Fixes issue raised by code checker in 23fe43ee0a0838e3b680f6dc55cd226e Change-Id: Ic5306c0c8d89734a606ab90addc6540621696553 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b2f4ee87d888941fd548d9a4009711d1c018073e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Allow creation of custom QQuickPopupItem-derived typesMitch Curtis2021-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | This allows QQuickPopup-derived types to have their own QQuickPopup-derived popup item. This is useful for controlling e.g. implicit content item sizing. Task-number: QTBUG-83630 Change-Id: I279d2e39df9a9cff29b3015a2f5baae7128f461f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6b8a9673111bbf888990ce5904e176057ad4a71b)
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-221-20/+20
|/ | | | | | | | | | | This reverts commit 950f8bff7cbbdbd472234fd32ef659c9d0e8ba7c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I69e514934864bea3ccd68de9a65fb08e262325a1 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-221-20/+20
| | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtquickcontrols2. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4209 Change-Id: I4175d7a58cb1b04172132a3bc09aea1b065d1778 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickMenu: fix heap-use-after-freeMitch Curtis2020-09-291-0/+10
| | | | | | | | | | | | | | | | The previous patch fixed a memory leak, which in turn exposed an issue caused by item change listeners not being removed before contentModel is destroyed. QQuickMenuPrivate::itemParentChanged() then tried to access that contentModel, resulting in a heap-use-after-free. This patch fixes the issue by removing all menu items before the menu is destroyed, ensuring that the change listeners are removed in time. Task-number: QTBUG-86851 Change-Id: I3dc0a251d7fd9c05c384de6472e73493b2d5b664 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 5e4f4ed2410a29914a70b7c7d0b7b4f3a136f289) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickMenu: fix contentModel memory leakMitch Curtis2020-09-291-1/+6
| | | | | | | | | | | | Q_Q should not be used in a QObjectPrivate-derivative's constructor, as q will be null at that stage. Instead, add QQuickMenuPrivate::init() and create the contentModel there. Fixes: QTBUG-86851 Change-Id: Ia2a955e718cc0486af5a05e24fcfcb1c4bacb48d Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit f12e2061c460504d6db1d1370e97b5eeead9c7bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: explain how to allow Menu to move outside of the window via marginsMitch Curtis2020-05-211-0/+8
| | | | | | | | Task-number: QTBUG-82279 Change-Id: Ibc9bae71995f140882dd0f636ff360af8ac0337c Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 26679453b26bed18d873fbbcc758dce112e22189) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Fix qdoc warningsVenugopal Shivashankar2019-11-261-3/+4
| | | | | | | | | | | The warnings were about: - Undocumented function parameters - Instances of \instantiates that us an internal class - A few link issues Task-number: QTBUG-79827 Change-Id: I60094279c7da6bc446b5c63b7b4924b71cee4672 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-241-0/+2
|\ | | | | | | Change-Id: I34f3fa5e3cd2ebb0ed8f7d4e6d5ed6f66422a48d
| * Fix timer events handlingKonstantin Ritt2019-09-121-0/+2
| | | | | | | | | | | | | | | | if the timer event's timerId isn't recognized, make sure control passes to the base class Change-Id: If5988dbf4ccda6a9887805961b439f93640f71ea Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-041-0/+13
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ib55ecb95e5ae47cc7a46f136a2f2eb158676ea34
| * Doc: Add specs about focus propertyNico Vertriest2019-06-181-0/+13
| | | | | | | | | | | | Task-number: QTBUG-75546 Change-Id: I6e672c3a8390c4cf10dc9576cc3bf1eb10a6246b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-111-4/+20
|\| | | | | | | Change-Id: I2d9537a060ecbed1cc51dbebcc20b09753e41330
| * Fix MenuItem width not matching Menu's available widthMitch Curtis2019-05-031-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short version: There are currently two problems with MenuItems: - Mirrored MenuItems don't fill the Menu's available width. - MenuItem does not fill the Menu's available width when changed after Component completion. This patch fixes both of them by listening to geometry changes in both the contentItem and individual menu items, and setting the explicit width of those menu items when either changes. Longer version: The first problem can be seen whenever the MenuItem's implicitWidth changes: - QQmlEngine::retranslate() is called, causing all bindings to be re-evaluated - The MenuItem's font size changes - The MenuItem's icon size changes - etc. We fix this by making Menu listen to the width of each of its MenuItems and call resizeItem() if it doesn't have an explicit width. The second problem can be seen when e.g. resizing a Menu to account for new items that are wider and hence require more space. This can be fixed by listening to width changes in Menu's contentItem, which was actually done in earlier versions but (probably accidentally) removed in 482ecb0f. I had tried to solve both issues by setting the explicit width of MenuItem to the width of its Menu, or undefined if it has none (which means it reverts to its implicit width). However, this does not account for e.g. MenuSeparator and custom items that can be added to Menu - they should also have their width fill the Menu automatically if they don't have an explicit width set. Change-Id: I95dd0da0919a1e297f2e2030da746ff1f1a17644 Fixes: QTBUG-75051 Fixes: QTBUG-75142 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | quicktemplates2: Fix compilationFriedemann Kleint2019-05-031-1/+1
|/ | | | | | | | | After qtdeclarative/325e6305b418ffe1dfb9a36c2516c6a8a3de5733, QML models are in a new module. Change-Id: Ifa98380d4febd212628fb4007a3cc9dce98c995b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickMenu: don't give focus to disabled menu itemsMitch Curtis2019-02-041-2/+2
| | | | | | Change-Id: I7eb394ca3991eae585fbbd8e665c46b11ef64a07 Fixes: QTBUG-70181 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Menu: fix disabled sub-menu items being highlightedMitch Curtis2019-02-041-4/+23
| | | | | | | | | | | When a menu item with a sub-menu was triggered by key or mouse, it would open the sub-menu with the first menu item highlighted. This doesn't make sense for disabled menu items, so this patch makes it find the first enabled item. Change-Id: I9df1c750749e5a77b027b6f476b8ae1f5ea035bd Fixes: QTBUG-69540 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Revert all Menu delegate patchesv5.12.0-rc2v5.12.0-rc1v5.12.0Mitch Curtis2018-11-151-82/+17
| | | | | | | | | | | | | | | | | | | | | This reverts the following commits: d5cb26bc56a3b6f6e99c88654d4f7a65f43551ac - Menu: ensure the correct delegates are used when created via Component d923dd467c1aeb3e195a09949b04862084002f88 - MenuBar: ensure the correct delegates are used when created via Component d56c193eb4ceb640611d66f22e1f26aae91cd7d1 - QQuickPopupPositioner: avoid adding duplicate item change listeners 567a2de8cd493aabe0055d6dbc367b39447e70dd - Stabilize tst_qquickmenubar 953fbac6131823e4fce0eb4707a854469c4c04ff - Fix Instantiator-created MenuItems disappearing 936d31179d44220571ded15840bedeccb581c83b - tst_qquickmenu: add a test for MenuItems before and after a Repeater fc1832810f6c09505d9413685ed0b2d6295bea4a - QQuickMenuBar: fix menu not opening The fix for QTBUG-67559 has caused lots of issues, with the latest being a crash right before the 5.12 release. The bug that they fix is a P2, so it's not worth the hassle. The patches might be able to be resubmitted to dev after the crash is fixed. Change-Id: Ic192c7a302176bcdb2503b636b3462b10898a2ba Fixes: QTBUG-71770 Reviewed-by: J-P Nurmi <jpnurmi@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix Instantiator-created MenuItems disappearingMitch Curtis2018-11-021-4/+44
| | | | | | | | | | | | | | | When d5cb26bc fixed a bug in Menu, it also broke the use case of having an Instantiator create menu items. Using an Instantiator like this allows users to create a "Recent Files" menu, for example. The issue was that we would indiscriminately recreate items, even those owned by an Instantiator. This patch avoids recreating items owned by Instantiators. It also adds a logging category for Menu, to aid debugging. Fixes: QTBUG-71066 Change-Id: Ie0e46de1cbfaee81b43d63f3143435f2514371d5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-111-17/+42
|\ | | | | | | Change-Id: I3fa0011d8b69db2a004feb177a7f89ccb75a724d
| * Menu: ensure the correct delegates are used when created via ComponentMitch Curtis2018-09-051-17/+42
| | | | | | | | | | | | | | | | | | | | Don't add items until we're complete, as the delegate could change in the meantime. Instead, add them to contentData and create them when we're complete. Task-number: QTBUG-67559 Change-Id: I5f42129f49de861ff5f15d0069daeda0b4e5017c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQuickTheme: rename themeFont() and themePalette()J-P Nurmi2018-05-221-2/+2
| | | | | | | | | | | | | | We don't have the conflicting virtual getters anymore. Change-Id: Ia20bfa0a0b1aa67c35a23270eb0241018f8e0ada Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-071-7/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickabstractbutton_p_p.h src/quicktemplates2/qquickcombobox.cpp src/quicktemplates2/qquickcontainer.cpp src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickcontrol_p_p.h src/quicktemplates2/qquickdialog_p_p.h src/quicktemplates2/qquickdialogbuttonbox.cpp src/quicktemplates2/qquickdialogbuttonbox_p_p.h src/quicktemplates2/qquickdrawer.cpp src/quicktemplates2/qquickmenubar.cpp src/quicktemplates2/qquickmenubar_p_p.h src/quicktemplates2/qquickpage.cpp src/quicktemplates2/qquickpage_p_p.h src/quicktemplates2/qquickpane.cpp src/quicktemplates2/qquickpane_p_p.h src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquickrangeslider.cpp src/quicktemplates2/qquickscrollview.cpp src/quicktemplates2/qquickslider.cpp src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquickswipeview.cpp src/quicktemplates2/qquicktabbar.cpp src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p_p.h src/quicktemplates2/qquicktheme_p.h Change-Id: I6e2b8fe99e51e3e26c87546aa66af045bc429ec4
| * Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-7/+1
| | | | | | | | | | | | | | | | | | | | | | The code is more readable and less error-prone (this patch caught a few uninitialized members) when the members are initialized in the same place where they are declared. In many cases, empty default destructors can be entirely removed, and we get faster implicitly declared inline default constructors defined by the compiler. Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Replace QQuickMenuPrivate::reposition() with QQuickMenuPositionerJ-P Nurmi2018-05-031-10/+28
| | | | | | | | | | Change-Id: Iea8c1b8609778604af06cc70eaefad21f00186bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickTheme::ScopeJ-P Nurmi2018-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | Replace the old enums that were originally copied from QPlatformTheme, including irrelevant entries for DockWidget, MdiSubWindow, MessageBox, with a unified enum that will be matched to cover everything needed for theming fonts and palettes for Qt Quick Controls 2. Task-number: QTBUG-67062 Change-Id: Ia99d092f28c00210c0c7f24d4241eb5a5d9ceb5b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Move QQuickControlPrivate::themeFont|Palette() to QQuickThemeJ-P Nurmi2018-02-151-2/+2
|/ | | | | | | | | | | | | | QPlatformTheme is too limited for our theming purposes. We need support for separate palettes (and later, icon colors) in dark and light themes. Also, the fact that Qt Quick Controls 2 injects a platform proxy theme does have undesired side effects in Qt Widgets and Qt Quick Controls 1. Therefore, we start separating QPlatformTheme and QQuickTheme. The first step is to eliminate some direct QPlatformTheme access in QQuickControl and route it via QQuickTheme instead. Task-number: QTBUG-51921 Change-Id: I055471a75ed6f26968796496efd1892975447c98 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-101-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/CheckBox.qml src/imports/controls/CheckDelegate.qml src/imports/controls/ComboBox.qml src/imports/controls/DelayButton.qml src/imports/controls/Dial.qml src/imports/controls/ItemDelegate.qml src/imports/controls/MenuItem.qml src/imports/controls/RadioButton.qml src/imports/controls/RadioDelegate.qml src/imports/controls/SwipeDelegate.qml src/imports/controls/Switch.qml src/imports/controls/SwitchDelegate.qml src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc src/imports/controls/material/CheckDelegate.qml src/imports/controls/material/ItemDelegate.qml src/imports/controls/material/MenuItem.qml src/imports/controls/material/RadioDelegate.qml src/imports/controls/material/SwipeDelegate.qml src/imports/controls/material/SwitchDelegate.qml src/imports/controls/qquickdefaultbusyindicator.cpp src/imports/controls/qquickdefaultbusyindicator_p.h src/imports/controls/qtquickcontrols2plugin.cpp src/imports/controls/universal/CheckDelegate.qml src/imports/controls/universal/ItemDelegate.qml src/imports/controls/universal/MenuItem.qml src/imports/controls/universal/RadioDelegate.qml src/imports/controls/universal/SwipeDelegate.qml src/imports/controls/universal/SwitchDelegate.qml src/quickcontrols2/quickcontrols2.pri src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickpopup_p.h Change-Id: Ib25c8b4a7fe018b7c0ade9b02bfaaa6980118c15
| * Popups: use deferred executionJ-P Nurmi2017-12-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | QQuickPopup is backed by a QQuickControl subclass aka QQuickPopupItem. However, since the QML engine sees "background" and "contentItem" as properties of QQuickPopup, we must ensure that the deferred properties are executed for the QQuickPopup wrapper object. Task-number: QTBUG-50992 Change-Id: I2ec055b382e41530a6f4a740cb80853c0181c21a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Re-order revision 3 members and add explanatory commentsJ-P Nurmi2017-11-061-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | We've come to realize that even though it's tempting to group similar properties together, organizing the API so that revisions are grouped together makes future maintenance more pleasant. It's a lot easier to to see what was added and when. The same was done for earlier revisions in 5.9 in commit 430fe83. Change-Id: I738d7fdadd348c21737228c37d0f31e39b37f8e7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Introduce MenuBarJ-P Nurmi2017-07-261-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MenuBar is an ordinary Item. It can be located basically anywhere, but the idea is to introduce a new ApplicationWindow::menuBar property in a follow-up commit. Currently the example snippets are using the header property. [ChangeLog][Controls][MenuBar] Introduced a MenuBar control. Task-number: QTBUG-60350 Change-Id: Ie66dc457a3d8edbe8362fab2a591dc49442c95e2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: make sure to stop the hover timer when closingJ-P Nurmi2017-07-211-0/+2
| | | | | | | | | | | | | | | | This seems to be one of the reasons why tst_QQuickMenuBar has had troubles in a busy CI environment. Change-Id: Ifa20c309eac86e8f47ba0a8c3da76a58f00465cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: get rid of openSubMenu()J-P Nurmi2017-07-141-18/+15
| | | | | | | | | | Change-Id: I8125971dd91614984379e734af21f5ff28852667 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make QQuickMenu::popup() available in C++J-P Nurmi2017-07-131-24/+38
| | | | | | | | | | | | | | | | | | This is going to be used for sub-menus by QQuickMenu itself, by the upcoming QQuickMenuBar, and allows users to implement their own Menu navigation if desired. Change-Id: I29258e78fec27e8dd207ed649958df1a718bcd39 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: close non-cascading parent menu from prepareEnterTransition()J-P Nurmi2017-07-131-4/+3
| | | | | | | | | | Change-Id: I075241c07702d1e8bbc89c43cef35525d9e67cc7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: resolve the parent itemJ-P Nurmi2017-07-131-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | A cascading sub-menu is parented to the menu item in its parent menu, but a non-cascading sub-menu is parented to the parent menu's parent item to be able to have the sub-menu visible while the parent menu is hidden (non-cascading menus are opened and closed one by one). Based on these conditions, resolve the parent item automatically instead of doing it by hand in openSubMenu(). Change-Id: I5dd38ee0978604cd604dabf6f40ac4fb5f3eebbe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickMenu::countJ-P Nurmi2017-07-121-0/+15
| | | | | | | | | | | | | | [ChangeLog][Controls][Menu] Added "count" property. Change-Id: I42971a6bf8fd74b9f2d3df52f191b66cd7022b81 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: override reposition() to position sub-menusJ-P Nurmi2017-07-121-6/+17
| | | | | | | | | | Change-Id: Ia63148beee6b574e435a120be245601b3a0b3322 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: control allowHorizontalFlip from prepareEnterTransition()J-P Nurmi2017-07-121-3/+5
| | | | | | | | | | Change-Id: I0444e3e9137e1b71cdd16c35dc7cc47875937a22 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickMenuPrivate::setParentMenu()J-P Nurmi2017-07-121-4/+27
| | | | | | | | | | | | | | | | To help propagating the cascade-property automatically, instead of doing it manually in openSubMenu() that we're trying to get rid of. Change-Id: I3a3d59cafccc85d6affc325eb60e717e22b8f812 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: fix overlay change notifier signalJ-P Nurmi2017-07-121-1/+1
| | | | | | | | | | Change-Id: Ia8ffca05d6eba5214dec3a4675be0f7a109f06bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: control close policy from prepareEnterTransition()J-P Nurmi2017-07-121-3/+15
| | | | | | | | | | | | | | Moving stuff away from openSubMenu() until we can remove it... Change-Id: I0a979a6a0de25584a213b59e1d29d3b9f78b184e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu::popup(): allow a parent argumentJ-P Nurmi2017-07-121-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parent argument is handy for sharing a single context menu instance for multiple listview items: ListView { delegate: ItemDelegate { onPressAndHold: contextMenu.popup(this) } Menu { id: contextMenu } } Change-Id: I77ff87ee03d2d1b53485863ab9c99f3226496dfc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickMenu::dismiss()J-P Nurmi2017-07-111-35/+54
| | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Menu] Added a dismiss() method. Unlike close() that only closes a menu and its sub-menus, dismiss() closes the whole hierarchy of menus, including the parent menus. Change-Id: Ibde2102bbb542a5deefdf17843496b7b80021db4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: cleanup focus handlingJ-P Nurmi2017-07-111-10/+3
| | | | | | | | | | | | | | | | Since 744164e6, there is no more need to manually transfer the focus when dealing with nested menus. Change-Id: I8e283b2ef4501aa36d57b3e06190237a1fee7133 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Menu: leave transformOrigin to be defined in QMLJ-P Nurmi2017-07-111-6/+2
| | | | | | | | | | Change-Id: I960d90a7d1604f35a67dfe5f4adb57d4d62968f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: fix parent menu handlingJ-P Nurmi2017-07-111-5/+8
| | | | | | | | | | | | | | | | | | | | | | Set the parent menu when added as a sub-menu, and reset when removed from the parent menu, instead of waiting until the sub-menu is being opened and never reseting it. Furthermore, fix onItemTriggered() to not overwrite the original parentMenu value when iterating the parent menus to close them. Change-Id: If4cf9cd8794e34275f38a3b991e5c403725a8706 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>