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
qwidgetplatformsystemtrayicon_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWIDGETPLATFORMSYSTEMTRAYICON_P_H
5#define QWIDGETPLATFORMSYSTEMTRAYICON_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qpa/qplatformsystemtrayicon.h>
19#include <QtCore/private/qglobal_p.h>
20
21QT_REQUIRE_CONFIG(systemtrayicon);
22
24
25class QSystemTrayIcon;
26
28{
30
31public:
32 explicit QWidgetPlatformSystemTrayIcon(QObject *parent = nullptr);
34
35 void init() override;
36 void cleanup() override;
37 void updateIcon(const QIcon &icon) override;
38 void updateToolTip(const QString &tooltip) override;
39 void updateMenu(QPlatformMenu *menu) override;
40 QRect geometry() const override;
41 void showMessage(const QString &title, const QString &msg,
42 const QIcon &icon, MessageIcon iconType, int msecs) override;
43
44 bool isSystemTrayAvailable() const override;
45 bool supportsMessages() const override;
46
47 QPlatformMenu *createMenu() const override;
48
49private:
50 QScopedPointer<QSystemTrayIcon> m_systray;
51};
52
54
55#endif // QWIDGETPLATFORMSYSTEMTRAYICON_P_H
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
MessageIcon
This enum describes the icon that is shown when a balloon message is displayed.
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QSystemTrayIcon class provides an icon for an application in the system tray.
QPlatformMenu * createMenu() const override
This method allows platforms to use a different QPlatformMenu for system tray menus than what would n...
bool isSystemTrayAvailable() const override
Returns true if the system tray is available on the platform.
void updateMenu(QPlatformMenu *menu) override
This method is called when the system tray menu did change.
void cleanup() override
This method is called to cleanup the platform dependent implementation.
void updateToolTip(const QString &tooltip) override
This method is called when the tooltip text did change.
void init() override
This method is called to initialize the platform dependent implementation.
void updateIcon(const QIcon &icon) override
This method is called when the icon did change.
void showMessage(const QString &title, const QString &msg, const QIcon &icon, MessageIcon iconType, int msecs) override
Shows a balloon message for the entry with the given title, message msg and icon for the time specifi...
QRect geometry() const override
This method returns the geometry of the platform dependent system tray icon on the screen.
bool supportsMessages() const override
Returns true if the system tray supports messages on the platform.
Combined button and popup list for selecting options.
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
QPlatformSystemTrayIcon QWidgetPlatformSystemTrayIcon
QString title
[35]
QMenu menu
[5]