Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 5215

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qwhatsthis.cpp -->
  <title>QWhatsThis Class | Qt Widgets 5.12.6</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.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QWhatsThis</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></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="#static-public-members">Static Public Members</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">QWhatsThis Class</h1>
<!-- $$$QWhatsThis-brief -->
<p>The <a href="qwhatsthis.html">QWhatsThis</a> class provides a simple description of any widget, i.e&#x2e; answering the question &quot;What's This?&quot;. <a href="#details">More...</a></p>
<!-- @@@QWhatsThis -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QWhatsThis&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr></table></div><ul>
<li><a href="qwhatsthis-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QAction *</td><td class="memItemRight bottomAlign"><b><a href="qwhatsthis.html#createAction">createAction</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwhatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwhatsthis.html#hideText">hideText</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwhatsthis.html#inWhatsThisMode">inWhatsThisMode</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwhatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwhatsthis.html#showText">showText</a></b>(const QPoint &amp;<i>pos</i>, const QString &amp;<i>text</i>, QWidget *<i>w</i> = nullptr)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QWhatsThis-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qwhatsthis.html">QWhatsThis</a> class provides a simple description of any widget, i.e&#x2e; answering the question &quot;What's This?&quot;.</p>
<p>&quot;What's This?&quot; help is part of an application's online help system, and provides users with information about the functionality and usage of a particular widget. &quot;What's This?&quot; help texts are typically longer and more detailed than <a href="qtooltip.html">tooltips</a>, but generally provide less information than that supplied by separate help windows.</p>
<p><a href="qwhatsthis.html">QWhatsThis</a> provides a single window with an explanatory text that pops up when the user asks &quot;What's This?&quot;. The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a &quot;?&quot; button that users can click to enter &quot;What's This?&quot; mode; they then click the relevant widget to pop up the &quot;What's This?&quot; window. It is also possible to provide a a menu option or toolbar button to switch into &quot;What's This?&quot; mode.</p>
<p>To add &quot;What's This?&quot; text to a widget or an action, you simply call <a href="qwidget.html#whatsThis-prop">QWidget::setWhatsThis</a>() or <a href="qaction.html#whatsThis-prop">QAction::setWhatsThis</a>().</p>
<p>The text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet, making it possible to embed images in the displayed text. To be as fast as possible, the default stylesheet uses a simple method to determine whether the text can be rendered as plain text. See <a href="../qtgui/qt-sub-qtgui.html#mightBeRichText">Qt::mightBeRichText</a>() for details.</p>
<pre class="cpp">

      newAct <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qaction.html">QAction</a></span>(tr(<span class="string">&quot;&amp;New&quot;</span>)<span class="operator">,</span> <span class="keyword">this</span>);
      newAct<span class="operator">-</span><span class="operator">&gt;</span>setShortcut(tr(<span class="string">&quot;Ctrl+N&quot;</span>));
      newAct<span class="operator">-</span><span class="operator">&gt;</span>setStatusTip(tr(<span class="string">&quot;Create a new file&quot;</span>));
      newAct<span class="operator">-</span><span class="operator">&gt;</span>setWhatsThis(tr(<span class="string">&quot;Click this option to create a new file.&quot;</span>));

</pre>
<p>An alternative way to enter &quot;What's This?&quot; mode is to call <a href="qwhatsthis.html#createAction">createAction</a>(), and add the returned <a href="qaction.html">QAction</a> to either a menu or a tool bar. By invoking this context help action (in the picture below, the button with the arrow and question mark icon) the user switches into &quot;What's This?&quot; mode. If they now click on a widget the appropriate help text is shown. The mode is left when help is given or when the user presses Esc.</p>
<p class="centerAlign"><img src="images/whatsthis.png" alt="" /></p><p>You can enter &quot;What's This?&quot; mode programmatically with <a href="qwhatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a>(), check the mode with <a href="qwhatsthis.html#inWhatsThisMode">inWhatsThisMode</a>(), and return to normal mode with <a href="qwhatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a>().</p>
<p>If you want to control the &quot;What's This?&quot; behavior of a widget manually see <a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_CustomWhatsThis</a>.</p>
<p>It is also possible to show different help texts for different regions of a widget, by using a <a href="../qtgui/qhelpevent.html">QHelpEvent</a> of type <a href="../qtcore/qevent.html#Type-enum">QEvent::WhatsThis</a>. Intercept the help event in your widget's <a href="qwidget.html#event">QWidget::event</a>() function and call <a href="qwhatsthis.html#showText">QWhatsThis::showText</a>() with the text you want to display for the position specified in <a href="../qtgui/qhelpevent.html#pos">QHelpEvent::pos</a>(). If the text is rich text and the user clicks on a link, the widget also receives a <a href="../qtgui/qwhatsthisclickedevent.html">QWhatsThisClickedEvent</a> with the link's reference as <a href="../qtgui/qwhatsthisclickedevent.html#href">QWhatsThisClickedEvent::href</a>(). If a <a href="../qtgui/qwhatsthisclickedevent.html">QWhatsThisClickedEvent</a> is handled (i.e&#x2e; <a href="qwidget.html#event">QWidget::event</a>() returns true), the help window remains visible. Call <a href="qwhatsthis.html#hideText">QWhatsThis::hideText</a>() to hide it explicitly.</p>
</div>
<p><b>See also </b><a href="qtooltip.html">QToolTip</a>.</p>
<!-- @@@QWhatsThis -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$createAction[overload1]$$$createActionQObject* -->
<h3 class="fn" id="createAction"><a name="createAction"></a><code>[static] </code><span class="type"><a href="qaction.html">QAction</a></span> *QWhatsThis::<span class="name">createAction</span>(<span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Returns a ready-made <a href="qaction.html">QAction</a>, used to invoke &quot;What's This?&quot; context help, with the given <i>parent</i>.</p>
<p>The returned <a href="qaction.html">QAction</a> provides a convenient way to let users enter &quot;What's This?&quot; mode.</p>
<!-- @@@createAction -->
<!-- $$$enterWhatsThisMode[overload1]$$$enterWhatsThisMode -->
<h3 class="fn" id="enterWhatsThisMode"><a name="enterWhatsThisMode"></a><code>[static] </code><span class="type">void</span> QWhatsThis::<span class="name">enterWhatsThisMode</span>()</h3>
<p>This function switches the user interface into &quot;What's This?&quot; mode. The user interface can be switched back into normal mode by the user (e.g&#x2e; by them clicking or pressing Esc), or programmatically by calling <a href="qwhatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a>().</p>
<p>When entering &quot;What's This?&quot; mode, a <a href="../qtcore/qevent.html">QEvent</a> of type Qt::EnterWhatsThisMode is sent to all toplevel widgets.</p>
<p><b>See also </b><a href="qwhatsthis.html#inWhatsThisMode">inWhatsThisMode</a>() and <a href="qwhatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a>().</p>
<!-- @@@enterWhatsThisMode -->
<!-- $$$hideText[overload1]$$$hideText -->
<h3 class="fn" id="hideText"><a name="hideText"></a><code>[static] </code><span class="type">void</span> QWhatsThis::<span class="name">hideText</span>()</h3>
<p>If a &quot;What's This?&quot; window is showing, this destroys it.</p>
<p><b>See also </b><a href="qwhatsthis.html#showText">showText</a>().</p>
<!-- @@@hideText -->
<!-- $$$inWhatsThisMode[overload1]$$$inWhatsThisMode -->
<h3 class="fn" id="inWhatsThisMode"><a name="inWhatsThisMode"></a><code>[static] </code><span class="type">bool</span> QWhatsThis::<span class="name">inWhatsThisMode</span>()</h3>
<p>Returns <code>true</code> if the user interface is in &quot;What's This?&quot; mode; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qwhatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a>().</p>
<!-- @@@inWhatsThisMode -->
<!-- $$$leaveWhatsThisMode[overload1]$$$leaveWhatsThisMode -->
<h3 class="fn" id="leaveWhatsThisMode"><a name="leaveWhatsThisMode"></a><code>[static] </code><span class="type">void</span> QWhatsThis::<span class="name">leaveWhatsThisMode</span>()</h3>
<p>If the user interface is in &quot;What's This?&quot; mode, this function switches back to normal mode; otherwise it does nothing.</p>
<p>When leaving &quot;What's This?&quot; mode, a <a href="../qtcore/qevent.html">QEvent</a> of type Qt::LeaveWhatsThisMode is sent to all toplevel widgets.</p>
<p><b>See also </b><a href="qwhatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a>() and <a href="qwhatsthis.html#inWhatsThisMode">inWhatsThisMode</a>().</p>
<!-- @@@leaveWhatsThisMode -->
<!-- $$$showText[overload1]$$$showTextconstQPoint&constQString&QWidget* -->
<h3 class="fn" id="showText"><a name="showText"></a><code>[static] </code><span class="type">void</span> QWhatsThis::<span class="name">showText</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>pos</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> *<i>w</i> = nullptr)</h3>
<p>Shows <i>text</i> as a &quot;What's This?&quot; window, at global position <i>pos</i>. The optional widget argument, <i>w</i>, is used to determine the appropriate screen on multi-head systems.</p>
<p><b>See also </b><a href="qwhatsthis.html#hideText">hideText</a>().</p>
<!-- @@@showText -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>