Qt5 System Tray Icon with QtQuick 2
-
I am trying to add a system tray icon to my QtQuick 2 application. I found these two classes in the "docs":http://qt-project.org/doc/qt-5.0/qtdoc/classes.html:
QSystemTrayIcon and QPlatformSystemTrayIcon.When using the first QSystemTrayIcon class with the QtQuick2ApplicationViewer a second window is displayed by the QSystemTrayIcon class. I guess that it's caused by the fact that the first class is a QWidget based class and the second isn't.
Then I decided that I can use the QPlatformSystemTrayIcon which doesn't seem to inherit QWidget, but unfortunately when I try to include it "as described in the docs":http://qt-project.org/doc/qt-5.0/qtgui/qplatformsystemtrayicon.html I get an error message, that the class doesn't exist.
How am I supposed to include the QPlatformSystemTrayIcon class or is there an alternative for a system tray icon?
P.S. I don't believe that it has to do with the problem, but I am running Qt5 Final Release on Ubuntu 12.04 x86
-
If you check out newest Qt5 code from git or wait for Qt 5.1.0, it will be possible to embed QML apps (QWindows) into QtWidgets. That would probably help you solve this problem.
-
Take a look at this "Qt bug":https://bugreports.qt-project.org/browse/QTBUG-25643. It's probably not in the Qt5-git yet, you need to check out master branches (or whatever they are now called. I think it's either dev or stable nowadays).