aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenuitem.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickMenu: allow enter/return to be used to activate itemsMitch Curtis2019-02-281-0/+5
| | | | | | | | | | | Before this patch, only space was allowed. Windows 10 and macOS 10.14.2 both allow using enter to activate menu items. Change-Id: I64476347669ff73f233efd129563a18ba51618a5 Fixes: QTBUG-73354 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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-8/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
* | 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>
* MenuItem: use deferred execution for the arrowJ-P Nurmi2018-01-151-3/+37
| | | | | | Task-number: QTBUG-50992 Change-Id: Ifb41a8caf6b406249d6da4783c546816d9b51581 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Docs: make button icons sound as worthy as text labelsJ-P Nurmi2017-10-231-2/+2
| | | | | | | | Advertise text and icon properties equally. The additional mention of the icon property make icons sound somehow less worthy. :) Change-Id: I564954091ba9d484abda702ce4ba46ddebe7a082 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: revise the custom menu exampleJ-P Nurmi2017-07-041-2/+2
| | | | | | | | | 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>
* Enable and disable sub-menu items accordinglyJ-P Nurmi2017-06-221-1/+11
| | | | | | | | The menu item that presents a sub-menu now follows the sub-menu's enabled state. Change-Id: Iee200c14facf4d6d19dbbd8d5b8ad43482ca305a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add Menu::currentIndexJ-P Nurmi2017-06-211-0/+2
| | | | | | | | | | | | | | 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>
* Add support for cascading sub-menusJ-P Nurmi2017-06-131-1/+63
| | | | | | | | | | | | | 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>
* QQuickMenu: update the highlighted item on mouse hoverJ-P Nurmi2017-06-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* Add QQuickMenuItem::menuJ-P Nurmi2017-06-061-11/+26
| | | | | | | | [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>
* Implement defaultPalette()J-P Nurmi2017-05-261-0/+5
| | | | | Change-Id: I4345f6a3b61476287b6161d89b752735757f3a7e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* MenuItem: add support for iconsMitch Curtis2017-04-181-0/+4
| | | | | | Task-number: QTBUG-49820 Change-Id: I6b735a5c87ca8f3154722984d36a3a631dd19c38 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* qquickmenuitem.cpp: move defaultFont()J-P Nurmi2017-03-021-5/+5
| | | | | | | | It was placed after the constructor. Move it after properties to keep the same order as declared in the header. Change-Id: I91584f80a5a7eee139393f635b7465f5795c2332 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Port from QT_NO_ACCESSIBILITY to QT_CONFIG(accessibility)J-P Nurmi2017-02-241-1/+1
| | | | | Change-Id: I03deebff661746d49e537af5b1c8899b938efb0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-2/+2
| | | | | | | | | | | It was a bit inconsistent before. Admittedly the colon at the end was the most commonly used style in the quicktemplates2 code base, but some had a line-break before the colon. This is now chosen as the one true coding style of QQC2. ;) It makes the initializer list aligned so that it stands out from the constructor body. Change-Id: I66835e088df90d7219af04915176006d2a934ddc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Format initializer listsJ-P Nurmi2017-01-191-2/+2
| | | | | | | | Initialize one member per line. Allow empty constructors with one initialized member on a single line. Change-Id: Ie115802561ebd19efd4dacda1fa868b64d279109 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Restore AbstractButton::checkableJ-P Nurmi2016-11-161-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | In 7a8f055, we hid the checkable property from QQuickAbstractButton and exposed it only in QQuickButton and QQuickMenuItem. The reasoning was that QQuickCheckBox, QQuickRadioButton, QQuickSwitch and their delegate counterparts are inherently checkable, so having the checkable property available in QML didn't seem to make sense. While this still holds true, there are other factors to take into consideration. AbstractButton is meant to be a generic base class for all types of buttons, but the lack of a checkable property makes it unusable as a base class for custom QML-based checkable buttons. If we want to a hide the checkable property from CheckBox, RadioButton, and Switch to avoid having it popup in the auto-completion list, we can probably do it in a less disruptive way via tooling. [ChangeLog][Controls][AbstractButton] The checkable property has been made accessible from QML. Previously it was only exposed for Button and MenuItem, but it is now available for any AbstractButton to make it possible to create custom QML-based checkable buttons. Task-number: QTBUG-51554 Change-Id: I19e29fc87cd15811c43c9b9ebb29701d66cde72f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: revise brief descriptionsJ-P Nurmi2016-11-021-1/+1
| | | | | | Change-Id: If7bdd4c11aaeb2df87622c769b1a65ac82ac7e73 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* MenuItem: fix documentation review findingsMitch Curtis2016-09-211-13/+22
| | | | | | Change-Id: Iff356498b438e0f4373efce0131634439b5e6240 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Move highlighted to subclasses that actually use itMitch Curtis2016-04-271-1/+42
| | | | | Change-Id: I70468b35b2a3a03c6e2d557a67443291697c8b42 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: fix base type of MenuItemNikita Krupenko2016-04-261-1/+1
| | | | | Change-Id: I908fe8f0b1a49865a56ef385a8f4d7206f35b855 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-2/+0
| | | | | Change-Id: I5b0015476c3ceef8f82b00d99b084b1ce3bfaa6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: rename Qt.labs.controls 1.0 to QtQuick.Controls 2.0J-P Nurmi2016-04-211-3/+3
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Templates: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. Change-Id: I39ef9cbb00f55a32b7a43f11ffbdfbb40b84e124 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-0/+118
Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>