Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > b796bb6846bef0871594624de2c980c0 > files > 4129

qtbase5-doc-5.12.6-4.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" />
<!-- qsystemtrayicon.cpp -->
  <title>QSystemTrayIcon 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 >QSystemTrayIcon</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="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected 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">QSystemTrayIcon Class</h1>
<!-- $$$QSystemTrayIcon-brief -->
<p>The <a href="qsystemtrayicon.html">QSystemTrayIcon</a> class provides an icon for an application in the system tray. <a href="#details">More...</a></p>
<!-- @@@QSystemTrayIcon -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QSystemTrayIcon&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul>
<li><a href="qsystemtrayicon-members.html">List of all members, including inherited members</a></li>
<li><a href="qsystemtrayicon-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#ActivationReason-enum">ActivationReason</a></b> { Unknown, Context, DoubleClick, Trigger, MiddleClick }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#MessageIcon-enum">MessageIcon</a></b> { NoIcon, Information, Warning, Critical }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qsystemtrayicon.html#icon-prop">icon</a></b> : QIcon</li>
<li class="fn"><b><a href="qsystemtrayicon.html#toolTip-prop">toolTip</a></b> : QString</li>
<li class="fn"><b><a href="qsystemtrayicon.html#visible-prop">visible</a></b> : bool</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</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="qsystemtrayicon.html#QSystemTrayIcon">QSystemTrayIcon</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#QSystemTrayIcon-1">QSystemTrayIcon</a></b>(const QIcon &amp;<i>icon</i>, QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#dtor.QSystemTrayIcon">~QSystemTrayIcon</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#contextMenu">contextMenu</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#geometry">geometry</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#icon-prop">icon</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#visible-prop">isVisible</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#setContextMenu">setContextMenu</a></b>(QMenu *<i>menu</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#icon-prop">setIcon</a></b>(const QIcon &amp;<i>icon</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#toolTip-prop">setToolTip</a></b>(const QString &amp;<i>tip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#toolTip-prop">toolTip</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#hide">hide</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#visible-prop">setVisible</a></b>(bool <i>visible</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#show">show</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#showMessage">showMessage</a></b>(const QString &amp;<i>title</i>, const QString &amp;<i>message</i>, QSystemTrayIcon::MessageIcon <i>icon</i> = QSystemTrayIcon::Information, int <i>millisecondsTimeoutHint</i> = 10000)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#showMessage-1">showMessage</a></b>(const QString &amp;<i>title</i>, const QString &amp;<i>message</i>, const QIcon &amp;<i>icon</i>, int <i>millisecondsTimeoutHint</i> = 10000)</td></tr>
</table></div>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#activated">activated</a></b>(QSystemTrayIcon::ActivationReason <i>reason</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#messageClicked">messageClicked</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</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"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#isSystemTrayAvailable">isSystemTrayAvailable</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#supportsMessages">supportsMessages</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsystemtrayicon.html#event">event</a></b>(QEvent *<i>e</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QSystemTrayIcon-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qsystemtrayicon.html">QSystemTrayIcon</a> class provides an icon for an application in the system tray.</p>
<p>Modern operating systems usually provide a special area on the desktop, called the <i>system tray</i> or <i>notification area</i>, where long-running applications can display icons and short messages.</p>
<p class="centerAlign"><img src="images/system-tray.png" alt="The system tray on Windows XP." /></p><p>The <a href="qsystemtrayicon.html">QSystemTrayIcon</a> class can be used on the following platforms:</p>
<ul>
<li>All supported versions of Windows.</li>
<li>All window managers and independent tray implementations for X11 that implement the <a href="http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html freedesktop.org">http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2&#x2e;html freedesktop.org</a> XEmbed system tray specification.</li>
<li>All X11 desktop environments that implement the D-Bus <a href="http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem">http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem</a> specification, including recent versions of KDE and Unity.</li>
<li>All supported versions of macOS.</li>
</ul>
<p>To check whether a system tray is present on the user's desktop, call the <a href="qsystemtrayicon.html#isSystemTrayAvailable">QSystemTrayIcon::isSystemTrayAvailable</a>() static function.</p>
<p>To add a system tray entry, create a <a href="qsystemtrayicon.html">QSystemTrayIcon</a> object, call <a href="qsystemtrayicon.html#setContextMenu">setContextMenu</a>() to provide a context menu for the icon, and call <a href="qsystemtrayicon.html#show">show</a>() to make it visible in the system tray. Status notification messages (&quot;balloon messages&quot;) can be displayed at any time using <a href="qsystemtrayicon.html#showMessage">showMessage</a>().</p>
<p>If the system tray is unavailable when a system tray icon is constructed, but becomes available later, <a href="qsystemtrayicon.html">QSystemTrayIcon</a> will automatically add an entry for the application in the system tray if the icon is <a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<p>The <a href="qsystemtrayicon.html#activated">activated</a>() signal is emitted when the user activates the icon.</p>
<p>Only on X11, when a tooltip is requested, the <a href="qsystemtrayicon.html">QSystemTrayIcon</a> receives a <a href="../qtgui/qhelpevent.html">QHelpEvent</a> of type <a href="../qtcore/qevent.html#Type-enum">QEvent::ToolTip</a>. Additionally, the <a href="qsystemtrayicon.html">QSystemTrayIcon</a> receives wheel events of type <a href="../qtcore/qevent.html#Type-enum">QEvent::Wheel</a>. These are not supported on any other platform.</p>
</div>
<p><b>See also </b><a href="../qtgui/qdesktopservices.html">QDesktopServices</a>, <a href="qdesktopwidget.html">QDesktopWidget</a>, Desktop Integration, and <a href="qtwidgets-desktop-systray-example.html">System Tray Icon Example</a>.</p>
<!-- @@@QSystemTrayIcon -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ActivationReason$$$Unknown$$$Context$$$DoubleClick$$$Trigger$$$MiddleClick -->
<h3 class="fn" id="ActivationReason-enum"><a name="ActivationReason-enum"></a>enum QSystemTrayIcon::<span class="name">ActivationReason</span></h3>
<p>This enum describes the reason the system tray was activated.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::Unknown</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Unknown reason</td></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::Context</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The context menu for the system tray entry was requested</td></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::DoubleClick</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The system tray entry was double clicked.</td></tr>
</table></div>
<p><b>Note: </b>On macOS, a double click will only be emitted if no context menu is set, since the menu opens on mouse press</p><div class="table"><table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::Trigger</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The system tray entry was clicked</td></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::MiddleClick</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The system tray entry was clicked with the middle mouse button</td></tr>
</table></div>
<p><b>See also </b><a href="qsystemtrayicon.html#activated">activated</a>().</p>
<!-- @@@ActivationReason -->
<!-- $$$MessageIcon$$$NoIcon$$$Information$$$Warning$$$Critical -->
<h3 class="fn" id="MessageIcon-enum"><a name="MessageIcon-enum"></a>enum QSystemTrayIcon::<span class="name">MessageIcon</span></h3>
<p>This enum describes the icon that is shown when a balloon message is displayed.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::NoIcon</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">No icon is shown.</td></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::Information</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">An information icon is shown.</td></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::Warning</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">A standard warning icon is shown.</td></tr>
<tr><td class="topAlign"><code>QSystemTrayIcon::Critical</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">A critical warning icon is shown.</td></tr>
</table></div>
<p><b>See also </b><a href="qmessagebox.html">QMessageBox</a>.</p>
<!-- @@@MessageIcon -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$icon-prop$$$icon$$$setIconconstQIcon& -->
<h3 class="fn" id="icon-prop"><a name="icon-prop"></a><span class="name">icon</span> : <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span></h3>
<p>This property holds the system tray icon</p>
<p>On Windows, the system tray icon size is 16x16; on X11, the preferred size is 22x22. The icon will be scaled to the appropriate size as necessary.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QIcon </td><td class="memItemRight bottomAlign"><span class="name"><b>icon</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIcon</b></span>(const QIcon &amp;<i>icon</i>)</td></tr>
</table></div>
<!-- @@@icon -->
<!-- $$$toolTip-prop$$$toolTip$$$setToolTipconstQString& -->
<h3 class="fn" id="toolTip-prop"><a name="toolTip-prop"></a><span class="name">toolTip</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the tooltip for the system tray entry</p>
<p>On some systems, the tooltip's length is limited. The tooltip will be truncated if necessary.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>toolTip</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setToolTip</b></span>(const QString &amp;<i>tip</i>)</td></tr>
</table></div>
<!-- @@@toolTip -->
<!-- $$$visible-prop$$$isVisible$$$setVisiblebool -->
<h3 class="fn" id="visible-prop"><a name="visible-prop"></a><span class="name">visible</span> : <span class="type">bool</span></h3>
<p>This property holds whether the system tray entry is visible</p>
<p>Setting this property to true or calling <a href="qsystemtrayicon.html#show">show</a>() makes the system tray icon visible; setting this property to false or calling <a href="qsystemtrayicon.html#hide">hide</a>() hides it.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isVisible</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVisible</b></span>(bool <i>visible</i>)</td></tr>
</table></div>
<!-- @@@visible -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QSystemTrayIcon[overload1]$$$QSystemTrayIconQObject* -->
<h3 class="fn" id="QSystemTrayIcon"><a name="QSystemTrayIcon"></a>QSystemTrayIcon::<span class="name">QSystemTrayIcon</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a <a href="qsystemtrayicon.html">QSystemTrayIcon</a> object with the given <i>parent</i>.</p>
<p>The icon is initially invisible.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<!-- @@@QSystemTrayIcon -->
<!-- $$$QSystemTrayIcon$$$QSystemTrayIconconstQIcon&QObject* -->
<h3 class="fn" id="QSystemTrayIcon-1"><a name="QSystemTrayIcon-1"></a>QSystemTrayIcon::<span class="name">QSystemTrayIcon</span>(const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a <a href="qsystemtrayicon.html">QSystemTrayIcon</a> object with the given <i>icon</i> and <i>parent</i>.</p>
<p>The icon is initially invisible.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<!-- @@@QSystemTrayIcon -->
<!-- $$$~QSystemTrayIcon[overload1]$$$~QSystemTrayIcon -->
<h3 class="fn" id="dtor.QSystemTrayIcon"><a name="dtor.QSystemTrayIcon"></a><code>[virtual] </code>QSystemTrayIcon::<span class="name">~QSystemTrayIcon</span>()</h3>
<p>Removes the icon from the system tray and frees all allocated resources.</p>
<!-- @@@~QSystemTrayIcon -->
<!-- $$$activated[overload1]$$$activatedQSystemTrayIcon::ActivationReason -->
<h3 class="fn" id="activated"><a name="activated"></a><code>[signal] </code><span class="type">void</span> QSystemTrayIcon::<span class="name">activated</span>(<span class="type"><a href="qsystemtrayicon.html#ActivationReason-enum">QSystemTrayIcon::ActivationReason</a></span> <i>reason</i>)</h3>
<p>This signal is emitted when the user activates the system tray icon. <i>reason</i> specifies the reason for activation. <a href="qsystemtrayicon.html#ActivationReason-enum">QSystemTrayIcon::ActivationReason</a> enumerates the various reasons.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#ActivationReason-enum">QSystemTrayIcon::ActivationReason</a>.</p>
<!-- @@@activated -->
<!-- $$$contextMenu[overload1]$$$contextMenu -->
<h3 class="fn" id="contextMenu"><a name="contextMenu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QSystemTrayIcon::<span class="name">contextMenu</span>() const</h3>
<p>Returns the current context menu for the system tray entry.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#setContextMenu">setContextMenu</a>().</p>
<!-- @@@contextMenu -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[override virtual protected] </code><span class="type">bool</span> QSystemTrayIcon::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$geometry[overload1]$$$geometry -->
<h3 class="fn" id="geometry"><a name="geometry"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QSystemTrayIcon::<span class="name">geometry</span>() const</h3>
<p>Returns the geometry of the system tray icon in screen coordinates.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<!-- @@@geometry -->
<!-- $$$hide[overload1]$$$hide -->
<h3 class="fn" id="hide"><a name="hide"></a><code>[slot] </code><span class="type">void</span> QSystemTrayIcon::<span class="name">hide</span>()</h3>
<p>Hides the system tray entry.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#show">show</a>() and <a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<!-- @@@hide -->
<!-- $$$isSystemTrayAvailable[overload1]$$$isSystemTrayAvailable -->
<h3 class="fn" id="isSystemTrayAvailable"><a name="isSystemTrayAvailable"></a><code>[static] </code><span class="type">bool</span> QSystemTrayIcon::<span class="name">isSystemTrayAvailable</span>()</h3>
<p>Returns <code>true</code> if the system tray is available; otherwise returns <code>false</code>.</p>
<p>If the system tray is currently unavailable but becomes available later, <a href="qsystemtrayicon.html">QSystemTrayIcon</a> will automatically add an entry in the system tray if it is <a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<!-- @@@isSystemTrayAvailable -->
<!-- $$$messageClicked[overload1]$$$messageClicked -->
<h3 class="fn" id="messageClicked"><a name="messageClicked"></a><code>[signal] </code><span class="type">void</span> QSystemTrayIcon::<span class="name">messageClicked</span>()</h3>
<p>This signal is emitted when the message displayed using <a href="qsystemtrayicon.html#showMessage">showMessage</a>() was clicked by the user.</p>
<p>Currently this signal is not sent on macOS.</p>
<p><b>Note: </b>We follow Microsoft Windows behavior, so the signal is also emitted when the user clicks on a tray icon with a balloon message displayed.</p><p><b>See also </b><a href="qsystemtrayicon.html#activated">activated</a>().</p>
<!-- @@@messageClicked -->
<!-- $$$setContextMenu[overload1]$$$setContextMenuQMenu* -->
<h3 class="fn" id="setContextMenu"><a name="setContextMenu"></a><span class="type">void</span> QSystemTrayIcon::<span class="name">setContextMenu</span>(<span class="type"><a href="qmenu.html">QMenu</a></span> *<i>menu</i>)</h3>
<p>Sets the specified <i>menu</i> to be the context menu for the system tray icon.</p>
<p>The menu will pop up when the user requests the context menu for the system tray icon by clicking the mouse button.</p>
<p>On macOS, this is currenly converted to a NSMenu, so the aboutToHide() signal is not emitted.</p>
<p><b>Note: </b>The system tray icon does not take ownership of the menu. You must ensure that it is deleted at the appropriate time by, for example, creating the menu with a suitable parent object.</p><p><b>See also </b><a href="qsystemtrayicon.html#contextMenu">contextMenu</a>().</p>
<!-- @@@setContextMenu -->
<!-- $$$show[overload1]$$$show -->
<h3 class="fn" id="show"><a name="show"></a><code>[slot] </code><span class="type">void</span> QSystemTrayIcon::<span class="name">show</span>()</h3>
<p>Shows the icon in the system tray.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#hide">hide</a>() and <a href="qsystemtrayicon.html#visible-prop">visible</a>.</p>
<!-- @@@show -->
<!-- $$$showMessage[overload1]$$$showMessageconstQString&constQString&QSystemTrayIcon::MessageIconint -->
<h3 class="fn" id="showMessage"><a name="showMessage"></a><code>[slot] </code><span class="type">void</span> QSystemTrayIcon::<span class="name">showMessage</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>message</i>, <span class="type"><a href="qsystemtrayicon.html#MessageIcon-enum">QSystemTrayIcon::MessageIcon</a></span> <i>icon</i> = QSystemTrayIcon::Information, <span class="type">int</span> <i>millisecondsTimeoutHint</i> = 10000)</h3>
<p>Shows a balloon message for the entry with the given <i>title</i>, <i>message</i> and <i>icon</i> for the time specified in <i>millisecondsTimeoutHint</i>. <i>title</i> and <i>message</i> must be plain text strings.</p>
<p>Message can be clicked by the user; the <a href="qsystemtrayicon.html#messageClicked">messageClicked</a>() signal will emitted when this occurs.</p>
<p>Note that display of messages are dependent on the system configuration and user preferences, and that messages may not appear at all. Hence, it should not be relied upon as the sole means for providing critical information.</p>
<p>On Windows, the <i>millisecondsTimeoutHint</i> is usually ignored by the system when the application has focus.</p>
<p>Has been turned into a slot in Qt 5.2&#x2e;</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#show">show</a>() and <a href="qsystemtrayicon.html#supportsMessages">supportsMessages</a>().</p>
<!-- @@@showMessage -->
<!-- $$$showMessage$$$showMessageconstQString&constQString&constQIcon&int -->
<h3 class="fn" id="showMessage-1"><a name="showMessage-1"></a><code>[slot] </code><span class="type">void</span> QSystemTrayIcon::<span class="name">showMessage</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>message</i>, const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, <span class="type">int</span> <i>millisecondsTimeoutHint</i> = 10000)</h3>
<p>This function overloads <a href="qsystemtrayicon.html#showMessage">showMessage</a>().</p>
<p>Shows a balloon message for the entry with the given <i>title</i>, <i>message</i>, and custom icon <i>icon</i> for the time specified in <i>millisecondsTimeoutHint</i>.</p>
<p>This function was introduced in  Qt 5.9.</p>
<!-- @@@showMessage -->
<!-- $$$supportsMessages[overload1]$$$supportsMessages -->
<h3 class="fn" id="supportsMessages"><a name="supportsMessages"></a><code>[static] </code><span class="type">bool</span> QSystemTrayIcon::<span class="name">supportsMessages</span>()</h3>
<p>Returns <code>true</code> if the system tray supports balloon messages; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qsystemtrayicon.html#showMessage">showMessage</a>().</p>
<!-- @@@supportsMessages -->
</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>