-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
60 lines (43 loc) · 1.29 KB
/
main.cpp
File metadata and controls
60 lines (43 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright 2020 Sinodun Internet Technologies Ltd.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "mainwindow.h"
#include <QApplication>
#ifndef QT_NO_SYSTEMTRAYICON
#include <QMessageBox>
#include <QStyleFactory>
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(stubby);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication::setStyle(QStyleFactory::create("Fusion"));
QApplication a(argc, argv);
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
QMessageBox::critical(0, QObject::tr("Systray"),
QObject::tr("I couldn't detect any system tray "
"on this system."));
return 1;
}
QApplication::setQuitOnLastWindowClosed(false);
MainWindow w;
w.show();
return a.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