-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.cpp
40 lines (34 loc) · 1.2 KB
/
main.cpp
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
#include <QtCore/qcommandlineparser.h>
#include <QtWidgets/qapplication.h>
#include <QtWidgets/qstylefactory.h>
#include "lafdup_window.h"
#include "qtnetworkng.h"
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QApplication app(argc, argv);
app.setOrganizationDomain("lafdup.gigacores.com");
app.setOrganizationName("GigaCores");
app.setApplicationDisplayName("Sync Clipboard");
app.setApplicationName("SyncClipboard");
app.setApplicationVersion("1.0");
app.setWindowIcon(QIcon(":/images/bluefish.png"));
QCommandLineParser parser;
parser.setApplicationDescription("Keep clipboard synchroized to other PCs.");
parser.addHelpOption();
QCommandLineOption minimizedOption("m", "minimized after started.");
parser.addOption(minimizedOption);
parser.process(app);
#ifdef Q_OS_WIN
QFont f = app.font();
f.setFamily("微软雅黑");
app.setFont(f);
app.setStyle(QStyleFactory::create("fusion"));
#endif
LafdupWindow w;
if (!parser.isSet(minimizedOption)) {
w.showAndGetFocus();
}
return qtng::startQtLoop();
}