forked from 188080501/JQTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·82 lines (61 loc) · 1.83 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
This file is part of JQTools
Project introduce: https://github.com/188080501/JQTools
Copyright: Jason
Contact email: [email protected]
GitHub: https://github.com/188080501/
*/
// Qt lib import
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include <QVersionNumber>
#include <QMessageBox>
// JQLibrary import
#include "JQFoundation.h"
// JQToolsLibrary import
#include <JQToolsLibrary>
// Project lib import
#include <JQToolsManage>
// Group import
#include <WelcomeGroup>
#include <TextGroup>
#include <CalculateGroup>
#include <MakeGroup>
#include <ToolsGroup>
#include <QtGroup>
void checkVersion();
int main(int argc, char *argv[])
{
#ifdef Q_OS_WIN
qputenv( "QSG_RENDER_LOOP", "basic" );
#endif
QApplication app(argc, argv);
if ( !JQFoundation::singleApplication( "JQTools" ) )
{
QTimer::singleShot( 3000, qApp, &QCoreApplication::quit );
QMessageBox::warning(
nullptr,
QStringLiteral( "\u542F\u52A8\u5931\u8D25" ),
QStringLiteral( "\u7A0B\u5E8F\u5DF2\u7ECF\u542F\u52A8\n3\u79D2\u540E\u81EA\u52A8\u9000\u51FA" )
);
return -1;
}
if ( QThreadPool::globalInstance()->maxThreadCount() > 1 )
{
QThreadPool::globalInstance()->setMaxThreadCount( QThreadPool::globalInstance()->maxThreadCount() - 1 );
}
QQmlApplicationEngine engine;
JQToolsManage jqToolsManage;
jqToolsManage.setQmlApplicationEngine( &engine );
// Group initializa
WELCOMEGROUP_INITIALIZA
TEXTGROUP_INITIALIZA
CALCULATEGROUP_INITIALIZA
MAKEGROUP_INITIALIZA
TOOLSGROUP_INITIALIZA
QTGROUP_INITIALIZA
engine.rootContext()->setContextProperty( "JQToolsManage", &jqToolsManage );
engine.load( QUrl( "qrc:/main.qml" ) );
return app.exec();
}