Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 1 | #include<QApplication> |
| 2 | #include "chatdialog.h" |
Zhenkai Zhu | 3a008fc | 2012-06-08 17:36:39 -0700 | [diff] [blame] | 3 | #include <QMessageBox> |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 4 | |
Alexander Afanasyev | b4b9229 | 2013-07-09 13:54:59 -0700 | [diff] [blame] | 5 | int main(int argc, char *argv[]) |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 6 | { |
Alexander Afanasyev | b4b9229 | 2013-07-09 13:54:59 -0700 | [diff] [blame] | 7 | // Q_INIT_RESOURCE(demo); |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 8 | QApplication app(argc, argv); |
Zhenkai Zhu | 3a008fc | 2012-06-08 17:36:39 -0700 | [diff] [blame] | 9 | |
| 10 | if (!QSystemTrayIcon::isSystemTrayAvailable()) { |
| 11 | QMessageBox::critical(0, QObject::tr("Systray"), |
| 12 | QObject::tr("I couldn't detect any system tray " |
| 13 | "on this system.")); |
| 14 | return 1; |
| 15 | } |
Alexander Afanasyev | b4b9229 | 2013-07-09 13:54:59 -0700 | [diff] [blame] | 16 | QApplication::setQuitOnLastWindowClosed (false); |
| 17 | |
Zhenkai Zhu | 3a008fc | 2012-06-08 17:36:39 -0700 | [diff] [blame] | 18 | #ifdef __APPLE__ |
| 19 | app.setWindowIcon(QIcon(":/demo.icns")); |
| 20 | #else |
| 21 | app.setWindowIcon(QIcon(":/images/icon_large.png")); |
| 22 | #endif |
| 23 | |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 24 | ChatDialog dialog; |
Alexander Afanasyev | b4b9229 | 2013-07-09 13:54:59 -0700 | [diff] [blame] | 25 | |
| 26 | dialog.show (); |
| 27 | dialog.activateWindow (); |
| 28 | dialog.raise (); |
| 29 | |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 30 | return app.exec(); |
| 31 | } |