4#ifndef QWINDOWSSYSTEMTRAYICON_H
5#define QWINDOWSSYSTEMTRAYICON_H
7#include <QtGui/qicon.h>
8#include <QtGui/qpa/qplatformsystemtrayicon.h>
10#include <QtCore/qpointer.h>
11#include <QtCore/qstring.h>
12#include <QtCore/qt_windows.h>
32 void showMessage(
const QString &title,
const QString &msg,
33 const QIcon &icon, MessageIcon iconType,
int msecs)
override;
40 bool winEvent(
const MSG &message,
long *result);
42#ifndef QT_NO_DEBUG_STREAM
47 bool isInstalled()
const {
return m_hwnd !=
nullptr; }
48 bool ensureInstalled();
50 bool sendTrayMessage(DWORD msg);
51 bool setIconVisible(
bool visible);
52 bool isIconVisible()
const;
53 HICON createIcon(
const QIcon &icon);
57 HWND m_hwnd =
nullptr;
58 HICON m_hIcon =
nullptr;
59 HICON m_hMessageIcon =
nullptr;
60 mutable QPointer<QWindowsPopupMenu> m_menu;
61 bool m_ignoreNextMouseRelease =
false;
62 bool m_visible =
false;
65#ifndef QT_NO_DEBUG_STREAM
\inmodule QtCore\reentrant
Singleton container for all relevant information.
QWindowsScreenManager & screenManager()
static QWindowsContext * instance()
const QWindowsScreen * screenAtDp(const QPoint &p) const
Windows native system tray icon.
void cleanup() override
This method is called to cleanup the platform dependent implementation.
bool supportsMessages() const override
Returns true if the system tray supports messages on the platform.
bool isSystemTrayAvailable() const override
Returns true if the system tray is available on the platform.
bool winEvent(const MSG &message, long *result)
void formatDebug(QDebug &d) const
void updateMenu(QPlatformMenu *) override
This method is called when the system tray menu did change.
QPlatformMenu * createMenu() const override
This method allows platforms to use a different QPlatformMenu for system tray menus than what would n...
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.
~QWindowsSystemTrayIcon() override
Q_GLOBAL_STATIC(QReadWriteLock, g_updateMutex)
static void setIconVisibility(NOTIFYICONDATA &tnd, bool v)
static HWND createTrayIconMessageWindow()
static const UINT q_uNOTIFYICONID
static void initNotifyIconData(NOTIFYICONDATA &tnd)
static void setIconContents(NOTIFYICONDATA &tnd, const QString &tip, HICON hIcon)
static uint MYWM_TASKBARCREATED
static void qStringToLimitedWCharArray(QString in, wchar_t *target, int maxLength)
static int indexOfHwnd(HWND hwnd)
QWindowsSystemTrayIcon * trayIcon