/usr/share/qt5/doc/qtquickcontrols2/qml-qtquick-controls2-tooltip.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 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 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquicktooltip.cpp -->
<title>ToolTip 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 >ToolTip 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="#attached-properties">Attached Properties</a></li>
<li class="level1"><a href="#attached-methods">Attached Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#attached-tool-tips">Attached Tool Tips</a></li>
<li class="level2"><a href="#delay-and-timeout">Delay and Timeout</a></li>
<li class="level2"><a href="#custom-tool-tips">Custom Tool Tips</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">ToolTip QML Type</h1>
<span class="subtitle"></span>
<!-- $$$ToolTip-brief -->
<p>Provides tool tips for any control. <a href="#details">More...</a></p>
<!-- @@@ToolTip -->
<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-tooltip-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-tooltip.html#delay-prop">delay</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#text-prop">text</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#timeout-prop">timeout</a></b></b> : int</li>
</ul>
<a name="attached-properties"></a>
<h2 id="attached-properties">Attached Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#delay-attached-prop">delay</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#text-attached-prop">text</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#timeout-attached-prop">timeout</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#toolTip-attached-prop">toolTip</a></b></b> : ToolTip</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-tooltip.html#visible-attached-prop">visible</a></b></b> : bool</li>
</ul>
<a name="attached-methods"></a>
<h2 id="attached-methods">Attached Methods</h2>
<ul>
<li class="fn">void <b><b><a href="qml-qtquick-controls2-tooltip.html#hide-method">hide</a></b></b>()</li>
<li class="fn">void <b><b><a href="qml-qtquick-controls2-tooltip.html#show-method">show</a></b></b>(string <i>text</i>, int <i>timeout</i>)</li>
</ul>
<!-- $$$ToolTip-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>A tool tip is a short piece of text that informs the user of a control's function. It is typically placed above or below the parent control. The tip text can be any <a href="../qtgui/richtext.html">rich text</a> formatted string.</p>
<p class="centerAlign"><img src="images/qtquickcontrols2-tooltip.png" alt="" /></p><a name="attached-tool-tips"></a>
<h3 >Attached Tool Tips</h3>
<p>The most straight-forward way to setup tool tips for controls is to specify <a href="qml-qtquick-controls2-tooltip.html#text-attached-prop">text</a> and <a href="qml-qtquick-controls2-tooltip.html#visible-attached-prop">visibility</a> via attached properties. The following example illustrates this approach:</p>
<pre class="qml">
<span class="type"><a href="qml-qtquick-controls2-button.html">Button</a></span> {
<span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">"Save"</span>)
<span class="name">ToolTip</span>.visible: <span class="name">down</span>
<span class="name">ToolTip</span>.text: <span class="name">qsTr</span>(<span class="string">"Save the active project"</span>)
}
</pre>
<p>Under normal circumstances, there is only one tool tip visible at a time. In order to save resources, all items that use the <a href="qml-qtquick-controls2-tooltip.html">ToolTip</a> attached property share the same visual tool tip label instance. Even though the visuals are shared, <code>text</code>, <code>timeout</code> and <code>delay</code> are stored individually for each item that uses the respective attached property. However, multiple items cannot make the shared tool tip visible at the same time. The shared tool tip is only shown for the last item that made it visible. The position of the shared tool tip is determined by the framework.</p>
<a name="delay-and-timeout"></a>
<h3 >Delay and Timeout</h3>
<p>Tool tips are typically transient in a sense that they are shown as a result of a certain external event or user interaction, and they usually hide after a certain timeout. It is possible to control the delay when a tool tip is shown, and the timeout when it is hidden. This makes it possible to implement varying strategies for showing and hiding tool tips.</p>
<p>For example, on touch screens, it is a common pattern to show a tool tip as a result of pressing and holding down a button. The following example demonstrates how to delay showing a tool tip until the press-and-hold interval is reached. In this example, the tool tip hides as soon as the button is released.</p>
<pre class="qml">
<span class="type"><a href="qml-qtquick-controls2-button.html">Button</a></span> {
<span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">"Button"</span>)
<span class="name">ToolTip</span>.visible: <span class="name">pressed</span>
<span class="name">ToolTip</span>.delay: <span class="name">Qt</span>.<span class="name">styleHints</span>.<span class="name">mousePressAndHoldInterval</span>
<span class="name">ToolTip</span>.text: <span class="name">qsTr</span>(<span class="string">"This tool tip is shown after pressing and holding the button down."</span>)
}
</pre>
<p>With pointer devices, however, it might be desired to show a tool tip as a result of hovering a button for a while. The following example presents how to show a tool tip after hovering a button for a second, and hide it after a timeout of five seconds.</p>
<pre class="qml">
<span class="type"><a href="qml-qtquick-controls2-button.html">Button</a></span> {
<span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">"Button"</span>)
<span class="name">hoverEnabled</span>: <span class="number">true</span>
<span class="name">ToolTip</span>.delay: <span class="number">1000</span>
<span class="name">ToolTip</span>.timeout: <span class="number">5000</span>
<span class="name">ToolTip</span>.visible: <span class="name">hovered</span>
<span class="name">ToolTip</span>.text: <span class="name">qsTr</span>(<span class="string">"This tool tip is shown after hovering the button for a second."</span>)
}
</pre>
<a name="custom-tool-tips"></a>
<h3 >Custom Tool Tips</h3>
<p>Should one need more fine-grained control over the tool tip position, or multiple simultaneous tool tip instances are needed, it is also possible to create local tool tip instances. This way, it is possible to <a href="qtquickcontrols2-customize.html#customizing-tooltip">customize</a> the tool tip, and the whole <a href="qml-qtquick-controls2-popup.html">Popup</a> API is available. The following example presents a tool tip that presents the value of a slider when the handle is dragged.</p>
<p class="centerAlign"><img src="images/qtquickcontrols2-tooltip-slider.png" alt="" /></p><pre class="qml">
<span class="type"><a href="qml-qtquick-controls2-slider.html">Slider</a></span> {
<span class="name">id</span>: <span class="name">slider</span>
<span class="name">value</span>: <span class="number">0.5</span>
<span class="type"><a href="qml-qtquick-controls2-tooltip.html">ToolTip</a></span> {
<span class="name">parent</span>: <span class="name">slider</span>.<span class="name">handle</span>
<span class="name">visible</span>: <span class="name">slider</span>.<span class="name">pressed</span>
<span class="name">text</span>: <span class="name">slider</span>.<span class="name">value</span>.<span class="name">toFixed</span>(<span class="number">1</span>)
}
}
</pre>
<p><b>See also </b><a href="qtquickcontrols2-customize.html#customizing-tooltip">Customizing ToolTip</a> and <a href="qtquickcontrols2-popups.html">Popup Controls</a>.</p>
<!-- @@@ToolTip -->
<h2>Property Documentation</h2>
<!-- $$$delay -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="delay-prop">
<td class="tblQmlPropNode"><p>
<a name="delay-prop"></a><span class="name">delay</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the delay (milliseconds) after which the tool tip is shown. A tooltip with a negative delay is shown immediately. The default value is <code>0</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#delay-and-timeout">Delay and Timeout</a>.</p>
</div></div><!-- @@@delay -->
<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>This property holds the text shown on the tool tip.</p>
</div></div><!-- @@@text -->
<br/>
<!-- $$$timeout -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="timeout-prop">
<td class="tblQmlPropNode"><p>
<a name="timeout-prop"></a><span class="name">timeout</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the timeout (milliseconds) after which the tool tip is hidden. A tooltip with a negative timeout does not hide automatically. The default value is <code>-1</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#delay-and-timeout">Delay and Timeout</a>.</p>
</div></div><!-- @@@timeout -->
<br/>
<h2>Attached Property Documentation</h2>
<!-- $$$delay -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="delay-attached-prop">
<td class="tblQmlPropNode"><p>
<a name="delay-attached-prop"></a><span class="name">ToolTip.delay</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached property holds the delay (milliseconds) of the shared tool tip. The property can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a> and <a href="qml-qtquick-controls2-tooltip.html#delay-and-timeout">Delay and Timeout</a>.</p>
</div></div><!-- @@@delay -->
<br/>
<!-- $$$text -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="text-attached-prop">
<td class="tblQmlPropNode"><p>
<a name="text-attached-prop"></a><span class="name">ToolTip.text</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached property holds the text of the shared tool tip. The property can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a>.</p>
</div></div><!-- @@@text -->
<br/>
<!-- $$$timeout -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="timeout-attached-prop">
<td class="tblQmlPropNode"><p>
<a name="timeout-attached-prop"></a><span class="name">ToolTip.timeout</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached property holds the timeout (milliseconds) of the shared tool tip. The property can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a> and <a href="qml-qtquick-controls2-tooltip.html#delay-and-timeout">Delay and Timeout</a>.</p>
</div></div><!-- @@@timeout -->
<br/>
<!-- $$$toolTip -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="toolTip-attached-prop">
<td class="tblQmlPropNode"><p>
<a name="toolTip-attached-prop"></a><span class="name">ToolTip.toolTip</span> : <span class="type"><a href="qml-qtquick-controls2-tooltip.html">ToolTip</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached property holds the shared tool tip instance. The property can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a>.</p>
</div></div><!-- @@@toolTip -->
<br/>
<!-- $$$visible -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="visible-attached-prop">
<td class="tblQmlPropNode"><p>
<a name="visible-attached-prop"></a><span class="name">ToolTip.visible</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached property holds whether the shared tool tip is visible. The property can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a>.</p>
</div></div><!-- @@@visible -->
<br/>
<h2>Attached Method Documentation</h2>
<!-- $$$hide -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="hide-method">
<td class="tblQmlFuncNode"><p>
<a name="hide-method"></a><span class="type">void</span> <span class="name">hide</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached method hides the shared tooltip. The method can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a>.</p>
</div></div><!-- @@@hide -->
<br/>
<!-- $$$show -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="show-method">
<td class="tblQmlFuncNode"><p>
<a name="show-method"></a><span class="type">void</span> <span class="name">show</span>(<span class="type">string</span> <i>text</i>, <span class="type">int</span> <i>timeout</i> = -1)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This attached method shows the shared tooltip with <i>text</i> and <i>timeout</i> (milliseconds). The method can be attached to any item.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-tooltip.html#attached-tool-tips">Attached Tool Tips</a>.</p>
</div></div><!-- @@@show -->
<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>
|