/usr/share/qt5/doc/qtquickcontrols2/qml-qtquick-controls2-menu.html is in qtquickcontrols2-5-doc-html 5.9.5-0ubuntu2.
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 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickmenu.cpp -->
<title>Menu QML Type | Qt Quick Controls 2 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="qtquickcontrols2-index.html">Qt Quick Controls 2</a></td><td ><a href="qtquick-controls2-qmlmodule.html">QML Types</a></td><td >Menu 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="#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">Menu QML Type</h1>
<span class="subtitle"></span>
<!-- $$$Menu-brief -->
<p>Menu popup that can be used as a context menu or popup menu. <a href="#details">More...</a></p>
<!-- @@@Menu -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick.Controls 2.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.7</td></tr></table></div><ul>
<li><a href="qml-qtquick-controls2-menu-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-controls2-menu.html#contentData-prop">contentData</a></b></b> : list<Object></li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-menu.html#contentModel-prop">contentModel</a></b></b> : model</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-menu.html#title-prop">title</a></b></b> : string</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn">void <b><b><a href="qml-qtquick-controls2-menu.html#addItem-method">addItem</a></b></b>(Item <i>item</i>)</li>
<li class="fn">void <b><b><a href="qml-qtquick-controls2-menu.html#insertItem-method">insertItem</a></b></b>(int <i>index</i>, Item <i>item</i>)</li>
<li class="fn">Item <b><b><a href="qml-qtquick-controls2-menu.html#itemAt-method">itemAt</a></b></b>(int <i>index</i>)</li>
<li class="fn">void <b><b><a href="qml-qtquick-controls2-menu.html#moveItem-method">moveItem</a></b></b>(int <i>from</i>, int <i>to</i>)</li>
<li class="fn">void <b><b><a href="qml-qtquick-controls2-menu.html#removeItem-method">removeItem</a></b></b>(int <i>index</i>)</li>
</ul>
<!-- $$$Menu-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p class="centerAlign"><img src="images/qtquickcontrols2-menu.png" alt="" /></p><p>Menu has two main use cases:</p>
<ul>
<li>Context menus; for example, a menu that is shown after right clicking</li>
<li>Popup menus; for example, a menu that is shown after clicking a button</li>
</ul>
<pre class="cpp">
Button {
id: fileButton
text: <span class="string">"File"</span>
onClicked: menu<span class="operator">.</span>open()
Menu {
id: menu
y: fileButton<span class="operator">.</span>height
MenuItem {
text: <span class="string">"New..."</span>
}
MenuItem {
text: <span class="string">"Open..."</span>
}
MenuItem {
text: <span class="string">"Save"</span>
}
}
}
</pre>
<p>Typically, menu items are statically declared as children of the menu, but Menu also provides API to <a href="qml-qtquick-controls2-menu.html#addItem-method">add</a>, <a href="qml-qtquick-controls2-menu.html#insertItem-method">insert</a>, <a href="qml-qtquick-controls2-menu.html#moveItem-method">move</a> and <a href="qml-qtquick-controls2-menu.html#removeItem-method">remove</a> items dynamically. The items in a menu can be accessed using <a href="qml-qtquick-controls2-menu.html#itemAt-method">itemAt()</a> or <a href="qml-qtquick-controls2-popup.html#contentChildren-prop">contentChildren</a>.</p>
<p>Although <a href="qml-qtquick-controls2-menuitem.html">MenuItems</a> are most commonly used with Menu, it can contain any type of item.</p>
<p><b>See also </b><a href="qtquickcontrols2-customize.html#customizing-menu">Customizing Menu</a>, <a href="qtquickcontrols2-menus.html">Menu Controls</a>, and <a href="qtquickcontrols2-popups.html">Popup Controls</a>.</p>
<!-- @@@Menu -->
<h2>Property Documentation</h2>
<!-- $$$contentData -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentData-prop">
<td class="tblQmlPropNode"><p>
<a name="contentData-prop"></a><span class="qmldefault">[default] </span><span class="name">contentData</span> : <span class="type">list</span><<span class="type">Object</span>></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the list of content data.</p>
<p>The list contains all objects that have been declared in QML as children of the menu, and also items that have been dynamically added or inserted using the <a href="qml-qtquick-controls2-menu.html#addItem-method">addItem()</a> and <a href="qml-qtquick-controls2-menu.html#insertItem-method">insertItem()</a> methods, respectively.</p>
<p><b>Note: </b>Unlike <code>contentChildren</code>, <code>contentData</code> does include non-visual QML objects. It is not re-ordered when items are inserted or moved.</p><p><b>See also </b><a href="../qtquick/qml-qtquick-item.html#data-prop">Item::data</a> and <a href="qml-qtquick-controls2-popup.html#contentChildren-prop">contentChildren</a>.</p>
</div></div><!-- @@@contentData -->
<br/>
<!-- $$$contentModel -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentModel-prop">
<td class="tblQmlPropNode"><p>
<a name="contentModel-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">contentModel</span> : <span class="type">model</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the model used to display menu items.</p>
<p>The content model is provided for visualization purposes. It can be assigned as a model to a content item that presents the contents of the menu.</p>
<pre class="cpp">
Menu {
id: menu
contentItem: ListView {
model: menu<span class="operator">.</span>contentModel
}
}
</pre>
<p>The model allows menu items to be statically declared as children of the menu.</p>
</div></div><!-- @@@contentModel -->
<br/>
<!-- $$$title -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="title-prop">
<td class="tblQmlPropNode"><p>
<a name="title-prop"></a><span class="name">title</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the title for the menu.</p>
<p>The title of a menu is often displayed in the text of a menu item when the menu is a submenu, and in the text of a tool button when it is in a menubar.</p>
</div></div><!-- @@@title -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$addItem -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="addItem-method">
<td class="tblQmlFuncNode"><p>
<a name="addItem-method"></a><span class="type">void</span> <span class="name">addItem</span>(<span class="type"><a href="../qtquick/qml-qtquick-item.html">Item</a></span> <i>item</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Adds <i>item</i> to the end of the list of items.</p>
</div></div><!-- @@@addItem -->
<br/>
<!-- $$$insertItem -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="insertItem-method">
<td class="tblQmlFuncNode"><p>
<a name="insertItem-method"></a><span class="type">void</span> <span class="name">insertItem</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="../qtquick/qml-qtquick-item.html">Item</a></span> <i>item</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Inserts <i>item</i> at <i>index</i>.</p>
</div></div><!-- @@@insertItem -->
<br/>
<!-- $$$itemAt -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="itemAt-method">
<td class="tblQmlFuncNode"><p>
<a name="itemAt-method"></a><span class="type"><a href="../qtquick/qml-qtquick-item.html">Item</a></span> <span class="name">itemAt</span>(<span class="type">int</span> <i>index</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns the item at <i>index</i>, or <code>null</code> if it does not exist.</p>
</div></div><!-- @@@itemAt -->
<br/>
<!-- $$$moveItem -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="moveItem-method">
<td class="tblQmlFuncNode"><p>
<a name="moveItem-method"></a><span class="type">void</span> <span class="name">moveItem</span>(<span class="type">int</span> <i>from</i>, <span class="type">int</span> <i>to</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Moves an item <i>from</i> one index <i>to</i> another.</p>
</div></div><!-- @@@moveItem -->
<br/>
<!-- $$$removeItem -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="removeItem-method">
<td class="tblQmlFuncNode"><p>
<a name="removeItem-method"></a><span class="type">void</span> <span class="name">removeItem</span>(<span class="type">int</span> <i>index</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Removes the item at <i>index</i>.</p>
<p><b>Note: </b>The ownership of the item is transferred to the caller.</p></div></div><!-- @@@removeItem -->
<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>
|