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