<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qevent.cpp --> <title>QStatusTipEvent Class | Qt GUI 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="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QStatusTipEvent</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 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="#public-functions">Public Functions</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">QStatusTipEvent Class</h1> <!-- $$$QStatusTipEvent-brief --> <p>The <a href="qstatustipevent.html">QStatusTipEvent</a> class provides an event that is used to show messages in a status bar. <a href="#details">More...</a></p> <!-- @@@QStatusTipEvent --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QStatusTipEvent></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qevent.html">QEvent</a></td></tr></table></div><ul> <li><a href="qstatustipevent-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstatustipevent.html#QStatusTipEvent">QStatusTipEvent</a></b>(const QString &<i>tip</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qstatustipevent.html#tip">tip</a></b>() const</td></tr> </table></div> <ul> <li class="fn">6 public functions inherited from <a href="../qtcore/qevent.html#public-functions">QEvent</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">1 property inherited from <a href="../qtcore/qevent.html#properties">QEvent</a></li> <li class="fn">1 static public member inherited from <a href="../qtcore/qevent.html#static-public-members">QEvent</a></li> <li class="fn">2 protected variables inherited from <a href="../qtcore/qevent.html#protected-variables">QEvent</a></li> </ul> <a name="details"></a> <!-- $$$QStatusTipEvent-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qstatustipevent.html">QStatusTipEvent</a> class provides an event that is used to show messages in a status bar.</p> <p>Status tips can be set on a widget using the <a href="../qtwidgets/qwidget.html#statusTip-prop">QWidget::setStatusTip</a>() function. They are shown in the status bar when the mouse cursor enters the widget. For example:</p> <div class="table"><table class="generic" width="100%"> <tr valign="top" class="odd"><td ><pre class="cpp"> MainWindow<span class="operator">::</span>MainWindow(<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent) : <span class="type"><a href="../qtwidgets/qmainwindow.html">QMainWindow</a></span>(parent) { <span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> <span class="operator">*</span>myWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span>; myWidget<span class="operator">-</span><span class="operator">></span>setStatusTip(tr(<span class="string">"This is my widget."</span>)); setCentralWidget(myWidget); ... } </pre> </td><td ><p class="centerAlign"><img src="images/qstatustipevent-widget.png" alt="Widget with status tip." /></p></td></tr> </table></div> <p>Status tips can also be set on actions using the <a href="../qtwidgets/qaction.html#statusTip-prop">QAction::setStatusTip</a>() function:</p> <div class="table"><table class="generic" width="100%"> <tr valign="top" class="odd"><td ><pre class="cpp"> MainWindow<span class="operator">::</span>MainWindow(<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent) : <span class="type"><a href="../qtwidgets/qmainwindow.html">QMainWindow</a></span>(parent) { <span class="type"><a href="../qtwidgets/qmenu.html">QMenu</a></span> <span class="operator">*</span>fileMenu <span class="operator">=</span> menuBar()<span class="operator">-</span><span class="operator">></span>addMenu(tr(<span class="string">"File"</span>)); <span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>newAct <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span>(tr(<span class="string">"&New"</span>)<span class="operator">,</span> <span class="keyword">this</span>); newAct<span class="operator">-</span><span class="operator">></span>setStatusTip(tr(<span class="string">"Create a new file."</span>)); fileMenu<span class="operator">-</span><span class="operator">></span>addAction(newAct); ... } </pre> </td><td ><p class="centerAlign"><img src="images/qstatustipevent-action.png" alt="Action with status tip." /></p></td></tr> </table></div> <p>Finally, status tips are supported for the item view classes through the <a href="../qtcore/qt.html#ItemDataRole-enum">Qt::StatusTipRole</a> enum value.</p> </div> <p><b>See also </b><a href="../qtwidgets/qstatusbar.html">QStatusBar</a>, <a href="qhelpevent.html">QHelpEvent</a>, and <a href="qwhatsthisclickedevent.html">QWhatsThisClickedEvent</a>.</p> <!-- @@@QStatusTipEvent --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QStatusTipEvent[overload1]$$$QStatusTipEventconstQString& --> <h3 class="fn" id="QStatusTipEvent"><a name="QStatusTipEvent"></a>QStatusTipEvent::<span class="name">QStatusTipEvent</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>tip</i>)</h3> <p>Constructs a status tip event with the text specified by <i>tip</i>.</p> <p><b>See also </b><a href="qstatustipevent.html#tip">tip</a>().</p> <!-- @@@QStatusTipEvent --> <!-- $$$tip[overload1]$$$tip --> <h3 class="fn" id="tip"><a name="tip"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QStatusTipEvent::<span class="name">tip</span>() const</h3> <p>Returns the message to show in the status bar.</p> <p><b>See also </b><a href="../qtwidgets/qstatusbar.html#showMessage">QStatusBar::showMessage</a>().</p> <!-- @@@tip --> </div> </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>