Change-Id: Icca0bef7efca77a841b30f40692144663e7ae913
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
****************************************************************************/
#include <QApplication>
-#include <QMessageBox>
+#ifndef QT_NO_SYSTEMTRAYICON
+
+#include <QMessageBox>
#include "window.h"
int main(int argc, char *argv[])
window.show();
return app.exec();
}
+
+#else
+
+#include <QLabel>
+#include <QDebug>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QString text("QSystemTrayIcon is not supported on this platform");
+
+ QLabel *label = new QLabel(text);
+ label->setWordWrap(true);
+
+ label->show();
+ qDebug() << text;
+
+ app.exec();
+}
+
+#endif
****************************************************************************/
#include "window.h"
+
+#ifndef QT_NO_SYSTEMTRAYICON
+
#include <QtGui>
#include <QAction>
trayIcon = new QSystemTrayIcon(this);
trayIcon->setContextMenu(trayIconMenu);
}
+
+#endif
#define WINDOW_H
#include <QSystemTrayIcon>
+
+#ifndef QT_NO_SYSTEMTRAYICON
+
#include <QDialog>
QT_BEGIN_NAMESPACE
};
//! [0]
+#endif // QT_NO_SYSTEMTRAYICON
+
#endif