7#include <QtGui/qpa/qplatformsystemtrayicon.h>
8#include <qpa/qplatformtheme.h>
9#include <private/qguiapplication_p.h>
10#include <private/qhighdpiscaling_p.h>
12#include <QApplication>
15#ifndef QT_NO_SYSTEMTRAYICON
19QSystemTrayIconPrivate::QSystemTrayIconPrivate()
20 : qpa_sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon())
21 , visible(
false), trayWatcher(
nullptr)
46 auto screen = QGuiApplication::primaryScreen();
49 screen = menu->screen();
51 return QHighDpi::fromNativePixels(qpa_sys->geometry(), screen);
57 qpa_sys->updateIcon(icon);
65 addPlatformMenu(menu);
66 qpa_sys->updateMenu(menu->platformMenu());
68 qpa_sys->updateMenu(
nullptr);
77 qpa_sys->updateToolTip(toolTip);
82 QScopedPointer<QPlatformSystemTrayIcon> sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon());
84 return sys->isSystemTrayAvailable();
91 QScopedPointer<QPlatformSystemTrayIcon> sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon());
93 return sys->supportsMessages();
99 const QIcon &icon, QSystemTrayIcon::MessageIcon msgIcon,
int msecs)
102 qpa_sys->showMessage(title, message, icon,
103 static_cast<QPlatformSystemTrayIcon::MessageIcon>(msgIcon), msecs);
static bool isSystemTrayAvailable_sys()
~QSystemTrayIconPrivate()
QRect geometry_sys() const
static bool supportsMessages_sys()
QPlatformSystemTrayIcon * qpa_sys
void showMessage_sys(const QString &title, const QString &msg, const QIcon &icon, QSystemTrayIcon::MessageIcon msgIcon, int msecs)
Combined button and popup list for selecting options.