Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplatformsystemtrayicon.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2012 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QPLATFORMSYSTEMTRAYICON_H
6#define QPLATFORMSYSTEMTRAYICON_H
7
8#include <QtGui/qtguiglobal.h>
9#include <qpa/qplatformscreen.h>
10#include "QtCore/qobject.h"
11
12#ifndef QT_NO_SYSTEMTRAYICON
13
15
16class QPlatformMenu;
17class QIcon;
18class QString;
19class QRect;
20
21class Q_GUI_EXPORT QPlatformSystemTrayIcon : public QObject
22{
24public:
32 Q_ENUM(ActivationReason)
33
34 enum MessageIcon { NoIcon, Information, Warning, Critical };
35 Q_ENUM(MessageIcon)
36
39
40 virtual void init() = 0;
41 virtual void cleanup() = 0;
42 virtual void updateIcon(const QIcon &icon) = 0;
43 virtual void updateToolTip(const QString &tooltip) = 0;
44 virtual void updateMenu(QPlatformMenu *menu) = 0;
45 virtual QRect geometry() const = 0;
46 virtual void showMessage(const QString &title, const QString &msg,
47 const QIcon &icon, MessageIcon iconType, int msecs) = 0;
48
49 virtual bool isSystemTrayAvailable() const = 0;
50 virtual bool supportsMessages() const = 0;
51
52 virtual QPlatformMenu *createMenu() const;
53
58};
59
61
62#endif // QT_NO_SYSTEMTRAYICON
63
64#endif // QSYSTEMTRAYICON_P_H
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
\inmodule QtCore
Definition qobject.h:103
The QPlatformScreen class provides an abstraction for visual displays.
MessageIcon
This enum describes the icon that is shown when a balloon message is displayed.
virtual void cleanup()=0
This method is called to cleanup the platform dependent implementation.
void contextMenuRequested(QPoint globalPos, const QPlatformScreen *screen)
This signal is emitted when the context menu is requested.
virtual void updateIcon(const QIcon &icon)=0
This method is called when the icon did change.
virtual bool isSystemTrayAvailable() const =0
Returns true if the system tray is available on the platform.
void activated(QPlatformSystemTrayIcon::ActivationReason reason)
This signal is emitted when the user activates the system tray icon.
virtual void updateToolTip(const QString &tooltip)=0
This method is called when the tooltip text did change.
void messageClicked()
This signal is emitted when the message displayed using showMessage() was clicked by the user.
virtual void showMessage(const QString &title, const QString &msg, const QIcon &icon, MessageIcon iconType, int msecs)=0
Shows a balloon message for the entry with the given title, message msg and icon for the time specifi...
virtual QRect geometry() const =0
This method returns the geometry of the platform dependent system tray icon on the screen.
virtual bool supportsMessages() const =0
Returns true if the system tray supports messages on the platform.
virtual void updateMenu(QPlatformMenu *menu)=0
This method is called when the system tray menu did change.
ActivationReason
This enum describes the reason the system tray was activated.
virtual void init()=0
This method is called to initialize the platform dependent implementation.
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
QScreen * screen
[1]
Definition main.cpp:29
#define Q_ENUM(x)
#define Q_OBJECT
#define Q_SIGNALS
QString title
[35]
QMenu menu
[5]