-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
56 lines (45 loc) · 1.52 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
/*
This file is part of cPad Project.
cPad is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cPad is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cPad. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QTextCodec>
#include <QSplashScreen>
#include <QDesktopWidget>
int main(int argc, char *argv[])
{
QApplication cpad(argc, argv);
//设置translation编码为windows本地编码
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
//加载启动画面的图片
QPixmap pixmap(":/resources/splash.png");
//程序启动画面
QSplashScreen splash(pixmap);
for(qint64 i=5555555*9;i>0;i--)
splash.show();
//设置程序的组织名称
cpad.setOrganizationName("5-up");
//设置程序的名称
cpad.setApplicationName("cPad");
//主窗体并显示
MainWindow mainWindow;
mainWindow.show();
//启动画面结束
splash.finish(&mainWindow);
//如果有文件作为参数 打开文件
if (argc > 1) {
mainWindow.openArgvFile(argv[1]);
}
//程序执行 等待响应
return cpad.exec();
}