Mercurial > trustbridge
comparison ui/main.cpp @ 0:cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 07 Feb 2014 11:41:15 +0000 |
parents | |
children | 225a5ec20dad |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cb0cde2c5eb9 |
---|---|
1 #include "mainwindow.h" | |
2 | |
3 #include <QApplication> | |
4 #include <QSystemTrayIcon> | |
5 #include <QtPlugin> | |
6 #include <QMessageBox> | |
7 | |
8 | |
9 #ifdef Q_OS_WIN | |
10 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) | |
11 #else | |
12 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) | |
13 #endif | |
14 | |
15 int main(int argc, char **argv) | |
16 { | |
17 QApplication app (argc, argv); | |
18 | |
19 if (!QSystemTrayIcon::isSystemTrayAvailable()) { | |
20 QMessageBox::critical(0, QObject::tr("m13ui"), | |
21 QObject::tr("Couldn't detect any system tray " | |
22 "on this system. This software can only " | |
23 "be used in a desktop environment.")); | |
24 return 1; | |
25 } | |
26 QApplication::setQuitOnLastWindowClosed(false); | |
27 | |
28 MainWindow mainWin; | |
29 mainWin.show(); | |
30 | |
31 return app.exec(); | |
32 } |