Hi,
I’m quite new to how Qt QML (started learning Qt only from the QML days) works with Qt Gui or Widgets.
I can’t seem to include & compile QPlatformSystemTrayIcon: http://qt-project.org/doc/qt-5/qplatformsystemtrayicon.html
That is, I add the “QT += gui” (along with others which are needed) and do “#include <QPlatformSystemTrayIcon>”.
The include statement is showing to be missing. Perhaps the documentation is just outdated in terms of what needs to be included?
And I can’t seem to have anything show up using QSystemTrayIcon (it compiles at least): http://qt-project.org/doc/qt-5/qsystemtrayicon.html
But QSystemTrayIcon seems to be under “widgets”.
What I have is the default project setting that you get when you choose “Qt Quick Application”, using Qt Creator. That is, my main.cpp has something like the following:
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
// Some other qml register calls, to register custom qml types
///
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/MyProject/main.qml"));
return app.exec();
}
The QtQuick2ApplicationViewer inherits QQuickView; qtquick2applicationviewer.h & qtquick2applicationviewer.cpp are the classes that the project creates automatically.
Any help would be greatly appreciated.
Thanks.
↧








