summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowstheme.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-21 12:26:44 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-27 09:30:41 +0000
commitaffb6700a4a9621e5c80ac1f733f891cb31be701 (patch)
tree234602f2b76b076985d2f8ea8ea607c50e823b75 /src/plugins/platforms/windows/qwindowstheme.cpp
parent7849aa6e96aa923fca5523afc8cf88edcc0bcf90 (diff)
Windows QPA: Move system tray icon implementation into the plugin
The system tray icon implementation relied on QMenu. After the introduction of QPlatformSystemTrayIcon::contextMenuRequested(), the code can be moved into the plugin, making use of native menus when enabled or falling back to QMenu. This enables the SystemTrayIcon QML Type to work. [ChangeLog][QtGui][Windows] A native system tray icon is now available for SystemTrayIcon. Change-Id: I0fdbfb5cbb815c1ea6fb19305a9bceb9c5bcc034 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 5fe7c7c071..3165835d2d 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -48,6 +48,9 @@
#include "qwindowsdialoghelpers.h"
#include "qwindowscontext.h"
#include "qwindowsintegration.h"
+#if QT_CONFIG(systemtrayicon)
+# include "qwindowssystemtrayicon.h"
+#endif
#include "qt_windows.h"
#include <commctrl.h>
#include <objbase.h>
@@ -549,6 +552,13 @@ QPlatformDialogHelper *QWindowsTheme::createPlatformDialogHelper(DialogType type
return QWindowsDialogs::createHelper(type);
}
+#if QT_CONFIG(systemtrayicon)
+QPlatformSystemTrayIcon *QWindowsTheme::createPlatformSystemTrayIcon() const
+{
+ return new QWindowsSystemTrayIcon;
+}
+#endif
+
void QWindowsTheme::windowsThemeChanged(QWindow * window)
{
refresh();