/usr/share/qt5/doc/qtquickcontrols/qml-qtquick-controls-menuitem.html is in qtquickcontrols5-doc-html 5.9.5-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickmenuitem.cpp -->
<title>MenuItem QML Type | Qt Quick Controls 5.9</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
// loading style sheet breaks anchors that were jumped to before
// so force jumping to anchor again
setTimeout(function() {
var anchor = location.hash;
// need to jump to different anchor first (e.g. none)
location.hash = "#";
setTimeout(function() {
location.hash = anchor;
}, 0);
}, 0);
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td >Qt 5.9</td><td ><a href="qtquickcontrols-index.html">Qt Quick Controls</a></td><td ><a href="qtquick-controls-qmlmodule.html">QML Types</a></td><td >MenuItem QML Type</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.5 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">MenuItem QML Type</h1>
<span class="subtitle"></span>
<!-- $$$MenuItem-brief -->
<p><a href="qml-qtquick-controls-menuitem.html">MenuItem</a> provides an item to add in a menu or a menu bar. <a href="#details">More...</a></p>
<!-- @@@MenuItem -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick.Controls 1.4</td></tr></table></div><ul>
<li><a href="qml-qtquick-controls-menuitem-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#action-prop">action</a></b></b> : Action</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#checkable-prop">checkable</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#checked-prop">checked</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#enabled-prop">enabled</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#exclusiveGroup-prop">exclusiveGroup</a></b></b> : ExclusiveGroup</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#iconName-prop">iconName</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#iconSource-prop">iconSource</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#shortcut-prop">shortcut</a></b></b> : keysequence</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#text-prop">text</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#type-prop">type</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#visible-prop">visible</a></b></b> : bool</li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#toggled-signal">toggled</a></b></b>(<i>checked</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-controls-menuitem.html#triggered-signal">triggered</a></b></b>()</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn">void <b><b><a href="qml-qtquick-controls-menuitem.html#trigger-method">trigger</a></b></b>()</li>
</ul>
<!-- $$$MenuItem-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p class="centerAlign"><img src="images/menu.png" alt="" /></p><pre class="cpp">
Menu {
text: <span class="string">"Edit"</span>
MenuItem {
text: <span class="string">"Cut"</span>
shortcut: <span class="string">"Ctrl+X"</span>
onTriggered: <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
MenuItem {
text: <span class="string">"Copy"</span>
shortcut: <span class="string">"Ctrl+C"</span>
onTriggered: <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
MenuItem {
text: <span class="string">"Paste"</span>
shortcut: <span class="string">"Ctrl+V"</span>
onTriggered: <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
}
</pre>
<p><b>See also </b><a href="qml-qtquick-controls-menubar.html">MenuBar</a>, <a href="qml-qtquick-controls-menu.html">Menu</a>, <a href="qml-qtquick-controls-menuseparator.html">MenuSeparator</a>, and <a href="qml-qtquick-controls-action.html">Action</a>.</p>
<!-- @@@MenuItem -->
<h2>Property Documentation</h2>
<!-- $$$action -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="action-prop">
<td class="tblQmlPropNode"><p>
<a name="action-prop"></a><span class="name">action</span> : <span class="type"><a href="qml-qtquick-controls-action.html">Action</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The action bound to this menu item. It will provide values for all the properties of the menu item. However, it is possible to override the action's <code>text</code>, <code>iconSource</code>, and <code>iconName</code> properties by just assigning these properties, allowing some customization.</p>
<p>In addition, the menu item <code>triggered()</code> and <code>toggled()</code> signals will not be emitted. Instead, the action <code>triggered()</code> and <code>toggled()</code> signals will be.</p>
<p>Defaults to <code>null</code>, meaning no action is bound to the menu item.</p>
</div></div><!-- @@@action -->
<br/>
<!-- $$$checkable -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="checkable-prop">
<td class="tblQmlPropNode"><p>
<a name="checkable-prop"></a><span class="name">checkable</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Whether the menu item can be checked, or toggled. Defaults to <code>false</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#checked-prop">checked</a>.</p>
</div></div><!-- @@@checkable -->
<br/>
<!-- $$$checked -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="checked-prop">
<td class="tblQmlPropNode"><p>
<a name="checked-prop"></a><span class="name">checked</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>If the menu item is checkable, this property reflects its checked state. Defaults to <code>false</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#checkable-prop">checkable</a> and <a href="qml-qtquick-controls-action.html#toggled-signal">Action::toggled</a>.</p>
</div></div><!-- @@@checked -->
<br/>
<!-- $$$enabled -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="enabled-prop">
<td class="tblQmlPropNode"><p>
<a name="enabled-prop"></a><span class="name">enabled</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Whether the menu item is enabled, and responsive to user interaction. Defaults to <code>true</code>.</p>
</div></div><!-- @@@enabled -->
<br/>
<!-- $$$exclusiveGroup -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="exclusiveGroup-prop">
<td class="tblQmlPropNode"><p>
<a name="exclusiveGroup-prop"></a><span class="name">exclusiveGroup</span> : <span class="type"><a href="qml-qtquick-controls-exclusivegroup.html">ExclusiveGroup</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>If a menu item is checkable, an <a href="qml-qtquick-controls-exclusivegroup.html">ExclusiveGroup</a> can be attached to it. All the menu items sharing the same exclusive group, and by extension, any <a href="qml-qtquick-controls-action.html">Action</a> sharing it, become mutually exclusive selectable, meaning that only the last checked menu item will actually be checked.</p>
<p>Defaults to <code>null</code>, meaning no exclusive behavior is to be expected.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#checked-prop">checked</a> and <a href="qml-qtquick-controls-menuitem.html#checkable-prop">checkable</a>.</p>
</div></div><!-- @@@exclusiveGroup -->
<br/>
<!-- $$$iconName -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="iconName-prop">
<td class="tblQmlPropNode"><p>
<a name="iconName-prop"></a><span class="name">iconName</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Sets the icon name for the <a href="qml-qtquick-controls-menuitem.html">MenuItem</a> icon. This will pick the icon with the given name from the current theme. Overrides the item's bound action <code>iconName</code> property. Defaults to an empty string.</p>
<p><b>Note: </b>This property requires <a href="../qtwidgets/qapplication.html">QApplication</a>.</p><p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#iconSource-prop">iconSource</a> and <a href="qml-qtquick-controls-action.html#iconName-prop">Action::iconName</a>.</p>
</div></div><!-- @@@iconName -->
<br/>
<!-- $$$iconSource -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="iconSource-prop">
<td class="tblQmlPropNode"><p>
<a name="iconSource-prop"></a><span class="name">iconSource</span> : <span class="type"><a href="../qtqml/qml-url.html">url</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Sets the icon file or resource url for the <a href="qml-qtquick-controls-menuitem.html">MenuItem</a> icon. Overrides the item's bound action <code>iconSource</code> property. Defaults to an empty URL.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#iconName-prop">iconName</a> and <a href="qml-qtquick-controls-action.html#iconSource-prop">Action::iconSource</a>.</p>
</div></div><!-- @@@iconSource -->
<br/>
<!-- $$$shortcut -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="shortcut-prop">
<td class="tblQmlPropNode"><p>
<a name="shortcut-prop"></a><span class="name">shortcut</span> : <span class="type">keysequence</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Shortcut bound to the menu item. The keysequence can be a string or a <a href="../qtgui/qkeysequence.html#StandardKey-enum">standard key</a>.</p>
<p>Defaults to an empty string.</p>
<pre class="qml">
<span class="type"><a href="qml-qtquick-controls-menuitem.html">MenuItem</a></span> {
<span class="name">id</span>: <span class="name">copyItem</span>
<span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">"&Copy"</span>)
<span class="name">shortcut</span>: <span class="name">StandardKey</span>.<span class="name">Copy</span>
}
</pre>
<p><b>See also </b><a href="qml-qtquick-controls-action.html#shortcut-prop">Action::shortcut</a>.</p>
</div></div><!-- @@@shortcut -->
<br/>
<!-- $$$text -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="text-prop">
<td class="tblQmlPropNode"><p>
<a name="text-prop"></a><span class="name">text</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Text for the menu item. Overrides the item's bound action <code>text</code> property.</p>
<p>Mnemonics are supported by prefixing the shortcut letter with &. For instance, <code>"\&Open"</code> will bind the <code>Alt-O</code> shortcut to the <code>"Open"</code> menu item. Note that not all platforms support mnemonics.</p>
<p>Defaults to an empty string.</p>
<p><b>See also </b><a href="qml-qtquick-controls-action.html#text-prop">Action::text</a>.</p>
</div></div><!-- @@@text -->
<br/>
<!-- $$$type -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="type-prop">
<td class="tblQmlPropNode"><p>
<a name="type-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">type</span> : <span class="type">enumeration</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property is read-only and constant, and its value is <code>MenuItemType.Item</code>.</p>
</div></div><!-- @@@type -->
<br/>
<!-- $$$visible -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="visible-prop">
<td class="tblQmlPropNode"><p>
<a name="visible-prop"></a><span class="name">visible</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Whether the menu item should be visible. Defaults to <code>true</code>.</p>
</div></div><!-- @@@visible -->
<br/>
<h2>Signal Documentation</h2>
<!-- $$$toggled -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="toggled-signal">
<td class="tblQmlFuncNode"><p>
<a name="toggled-signal"></a><span class="name">toggled</span>(<i>checked</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Emitted whenever a menu item's <code>checked</code> property changes. This usually happens at the same time as <a href="qml-qtquick-controls-menuitem.html#triggered-signal">triggered</a>.</p>
<p>The corresponding handler is <code>onToggled</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#checked-prop">checked</a>, <a href="qml-qtquick-controls-menuitem.html#triggered-signal">triggered</a>, <a href="qml-qtquick-controls-action.html#triggered-signal">Action::triggered</a>, and <a href="qml-qtquick-controls-action.html#toggled-signal">Action::toggled</a>.</p>
</div></div><!-- @@@toggled -->
<br/>
<!-- $$$triggered -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="triggered-signal">
<td class="tblQmlFuncNode"><p>
<a name="triggered-signal"></a><span class="name">triggered</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Emitted when either the menu item or its bound action have been activated.</p>
<p>The corresponding handler is <code>onTriggered</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#trigger-method">trigger()</a>, <a href="qml-qtquick-controls-action.html#triggered-signal">Action::triggered</a>, and <a href="qml-qtquick-controls-action.html#toggled-signal">Action::toggled</a>.</p>
</div></div><!-- @@@triggered -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$trigger -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="trigger-method">
<td class="tblQmlFuncNode"><p>
<a name="trigger-method"></a><span class="type">void</span> <span class="name">trigger</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Manually trigger a menu item. Will also trigger the item's bound action.</p>
<p><b>See also </b><a href="qml-qtquick-controls-menuitem.html#triggered-signal">triggered</a> and <a href="qml-qtquick-controls-action.html#trigger-method">Action::trigger()</a>.</p>
</div></div><!-- @@@trigger -->
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|