Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
22
23QT_BEGIN_NAMESPACE
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
45 bool supportsMessages() const override;
46
47 QPlatformMenu *createMenu() const override;
48
49private:
50 QScopedPointer<QSystemTrayIcon> m_systray;
51};
52
53QT_END_NAMESPACE
54
55#endif // QWIDGETPLATFORMSYSTEMTRAYICON_P_H
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.
QT_REQUIRE_CONFIG(systemtrayicon)