| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: I8125971dd91614984379e734af21f5ff28852667
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: I075241c07702d1e8bbc89c43cef35525d9e67cc7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][Controls][Menu] Added "count" property.
Change-Id: I42971a6bf8fd74b9f2d3df52f191b66cd7022b81
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ia63148beee6b574e435a120be245601b3a0b3322
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I0444e3e9137e1b71cdd16c35dc7cc47875937a22
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: Ia8ffca05d6eba5214dec3a4675be0f7a109f06bd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Moving stuff away from openSubMenu() until we can remove it...
Change-Id: I0a979a6a0de25584a213b59e1d29d3b9f78b184e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: I960d90a7d1604f35a67dfe5f4adb57d4d62968f9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This complements the add/insert/remove/take API that was added for
actions and menus. Unlike for menu items, there was no convenient
way to access a specific action or menu directly without accessing
the respective item first.
[ChangeLog][Controls][Menu] Added actionAt() and menuAt() accessors.
Change-Id: I5515441626b3a04b05265d5b42afdaea8e256709
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In general, when shortcuts override key press events, the respective
key release events are still sent. Therefore, in order to respect
shortcuts, key navigation should be based on key press events. Key
release -based navigation is also not going to work with nested menus
in a menubar, because a leaf menu may need to propagate key events up
to the parent menus and finally to the menubar, but only if keys are
not actually handled.
Change-Id: Ia040a387adc782d8828250fbed393ef1794f2148
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use a single example for the whole menu. We can now use Actions and the
delegate property to use the styled menu item for the whole menu. The same
structure will be used for the upcoming MenuBar example.
Change-Id: Idbaa38cc536b27a4d64eb9ad72c07936bf160d6e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously mnemonics worked only for "normal" menu items, but not for
dynamically created menu items that present actions and sub-menus. This
patch fixes the issue by specifying the menu as a QObject-parent for
such dynamically created items, because QQuickShortcutContext is based
on QObject-hierarchy.
Change-Id: I3637ef06e9cb2a27673e4618c253279a0123b7c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/quicktemplates2/qquickmenu.cpp
Change-Id: I595ed1671fcad6c3b87123be2b825bca09552f0f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the OnReleaseOutside close policy, just use the defaults from
QQuickPopup. This way menus won't get immediately closed on release,
when opened from an onPressAndHold signal handler.
Task-number: QTBUG-61608
Change-Id: Ifedd596aa0e71ac5f4211fa42e2ae499918df1b2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
De-couple current index management from the content item. Instead of
manipulating the content item's current index directly from C++, offer
a currentIndex property that can be visualized by the style, also when
not using a ListView. This is essentially the same technique ComboBox
uses to control the highlighted index in the popup ListView.
[ChangeLog][Controls][Menu] Added currentIndex property for styling
purposes.
Change-Id: Idf7746d9c08fc9ca9a0dfd15225ebae5a29243c9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Allow sub-menus to open on the left side if there's more space than on
the right side. This is the expected behavior on desktop.
Change-Id: I915cb93e98a42bf50758d9e98fd98632e55c2cfa
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/imports/controls/ButtonGroup.qml
tests/auto/controls/data/tst_container.qml
tests/auto/menu/tst_menu.cpp
Change-Id: Ie8ee7e4f83f3fda6a09507b060576ebda929a7cd
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Skip non-focusable separators, and use a key focus reason
(Qt::TabFocusReason & Qt::BacktabFocusReason) to give the
items visual focus.
[ChangeLog][Controls][Menu] Fixed key navigation to skip separators.
Change-Id: I99affabc50703c7363ab8146e5ced9b45111de00
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QQuickContainer was fixed in the previous commit. Apply the same fix to
QQuickMenu, because the code is based on QQuickContainer. I'm not able
to make QQuickMenu crash with the same test case adapted to QQuickMenu,
though. QQuickMenu already has tests for Repeater in tst_menu.cpp.
Task-number: QTBUG-61310
Change-Id: I3fba1b7ef15659724880df080dab5015eae484a3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][Controls][Menu] Added addAction(), insertAction(),
removeAction(), and takeAction() methods for adding and removing
actions programmatically.
Change-Id: I7d494ef1edc1cf384314fa90d97cfd2290d2e8a3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][Controls][Menu] Added addMenu(), insertMenu(),
removeMenu(), and takeMenu() methods for adding and removing
sub-menus programmatically.
Change-Id: Ibf39448cdf528f64695b1ee5f0781384b754ba22
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This improves the usability on desktop. When a menu has multiple sub-
menu items, they don't all trigger a sub-menu (and close immediately)
while moving mouse over the items.
Change-Id: Ie4c9e409da8d6877e35506bffb94ed57f5985dcd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QQuickMenu was developed before QQuickControl::focusPolicy was added.
Now that QQuickAbstractButton sets Qt::StrongFocus, which includes
Qt::ClickFocus, by default, it gains active focus automatically and
there is no need to call forceActiveFocus() by hand. This patch does
not include new tests, because QQuickMenuItem's focus behavior is
already tested in tst_menu.
Change-Id: Ia2c9bed34548c3edbb54b8e5dc1207b3c7520b22
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds initial support for cascading sub-menus by allowing
one to nest declarative Menu declarations. A follow-up commit adds
support for adding, inserting, and removing menus programmatically.
[ChangeLog][Controls][Menu] Added support for cascading sub-menus.
Task-number: QTBUG-60351
Change-Id: I0eee4f74d92a97c09333fcc4348b019782448535
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
src/quicktemplates2/qquickapplicationwindow.cpp
src/quicktemplates2/qquickmenu.cpp
src/quicktemplates2/qquickmenu_p.h
src/quicktemplates2/qquickpopup.cpp
tests/auto/auto.pro
Change-Id: I856a022d38abd84763127539f46ef032ddc53c3d
|
| |
| |
| |
| |
| | |
Change-Id: I74e512074cbc66378ffd71f8040ae8977a3ffeac
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a small preparation step for cascading sub-menus. A menu item
that presents a sub-menu can connect the sub-menu's titleChanged()
directly to its setText() slot. The same technique is used for menu
items that present actions.
Task-number: QTBUG-60351
Change-Id: Id2c840d108167679d3a61caf35cbb0afacb6afe4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the expected behavior on desktop.
NOTE: It must be possible to mix mouse hover highlighting, and keyboard
navigation in the way that keyboard navigation must seamlessly continue
from the item that was previously mouse highlighted. Furthermore, there
should be only one item highlighted at a time. In order to be able to
respect keyboard navigation while another item is hovered and vice versa,
the visual highlight should be bound to MenuItem::highlighted instead of
Control::activeFocus or Control::hovered.
[ChangeLog][Controls][MenuItem] Menu has been fixed to highlight its
items while key navigating and mouse hovering to ensure seamless item
highlight between mouse hover and key navigation. In order to provide
appropriate highlighting that works for key navigation and mouse hover,
styles should bind their visual highlight to MenuItem::highlighted
instead of Control::activeFocus or Control::hovered.
Change-Id: I70cad5a5b441f2616d1ce2166e97974dc1ae063f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
If a specific menu item is passed to popup(), set the current index
appropriately to highlight the item.
Change-Id: Id7b687d1248127fe0c2cdb88d3ebd5689763fe24
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Deprecate removeItem(int) in favor of removeItem(Item) and
takeItem(int) with clearer semantics.
If one already has access to an item, one can pass it to removeItem()
to get rid of it for good, instead of having to call destroy() by hand.
If one knows the index instead, we provide a way to take the respective
item out of the menu, and let the user decide what to do with it. This
way we provide convenient ways to remove & destroy items in one go, and
to take items out without destroying them.
This nice pattern was once upon time planned for the QQC1 containers
such as SplitView, and should have been used for the QQC2 containers,
but was simply forgotten during the development...
[ChangeLog][Controls][Menu] Deprecated removeItem(int) in favor of
removeItem(Item) and takeItem(int) with clearer semantics. The former
destroys the item, whereas the latter transfers ownership to the
caller.
Change-Id: Id2a07fb65019b2904a013c8bcc3154089d36a0ea
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][Controls][MenuItem] Added a "menu" property that provides
access to the menu that contains the menu item.
Change-Id: I5edbf860756ba7ba9aef93d4992720327c10d1df
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I3cf7ec3b0c36e206f4899bcecc3d1d4fde98cfc3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][Controls][Menu] Added support for declaring Actions.
The new "delegate" property is used to define a Component that is
used to create menu items that present the actions.
Change-Id: If26f38f6910aa5592879703429a2b418193d5710
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][Controls][Menu] Added a popup() method that opens a menu
at the mouse cursor on desktop platforms that have a mouse cursor
available, and otherwise centers the menu over its parent item.
Task-number: QTBUG-50471
Change-Id: I9456a48e71fde91f73cdb268fcdd69a8511a41a4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|/
|
|
|
| |
Change-Id: I4345f6a3b61476287b6161d89b752735757f3a7e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: I03deebff661746d49e537af5b1c8899b938efb0d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|