aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenuitem.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-09-21 13:43:24 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-21 21:40:11 +0000
commit54d276edc92d87a88136b2c31396e8ef45a71290 (patch)
tree0e28e6148b20014fa12de8a938f072e66d60974a /src/quicktemplates2/qquickmenuitem.cpp
parent292266d5f728f0a8ad5f288954ac7ebe4210a2a3 (diff)
MenuItem: fix documentation review findings
Change-Id: Iff356498b438e0f4373efce0131634439b5e6240 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickmenuitem.cpp')
-rw-r--r--src/quicktemplates2/qquickmenuitem.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/quicktemplates2/qquickmenuitem.cpp b/src/quicktemplates2/qquickmenuitem.cpp
index 35942f92..902889b0 100644
--- a/src/quicktemplates2/qquickmenuitem.cpp
+++ b/src/quicktemplates2/qquickmenuitem.cpp
@@ -52,26 +52,30 @@ QT_BEGIN_NAMESPACE
\brief A menu item within a Menu.
MenuItem is a convenience type that implements the AbstractButton API,
- providing an easy way to respond to menu items being clicked, for example.
+ providing a familiar way to respond to menu items being \l triggered, for
+ example.
\code
Button {
id: fileButton
text: "File"
onClicked: menu.open()
- }
- Menu {
- id: menu
- anchor.target: fileButton
- MenuItem {
- text: "New..."
- }
- MenuItem {
- text: "Open..."
- }
- MenuItem {
- text: "Save"
+ Menu {
+ id: menu
+
+ MenuItem {
+ text: "New..."
+ onTriggered: document.reset()
+ }
+ MenuItem {
+ text: "Open..."
+ onTriggered: openDialog.open()
+ }
+ MenuItem {
+ text: "Save"
+ onTriggered: saveDialog.open()
+ }
}
}
\endcode
@@ -110,6 +114,11 @@ QQuickMenuItem::QQuickMenuItem(QQuickItem *parent) :
\qmlproperty bool QtQuick.Controls::MenuItem::checkable
This property holds whether the menu item is checkable.
+
+ A checkable menu item toggles between checked (on) and unchecked (off) when
+ the user clicks on it or interacts with it via the keyboard.
+
+ \sa {AbstractButton::}{checked}
*/
void QQuickMenuItem::checkableChange()