-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
34 lines (33 loc) · 963 Bytes
/
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
#include "mainwindow.h"
#include "dialog.h"
#include "about.h"
#include "settings.h"
#include "speed.h"
#include "first.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
Dialog d;
About ab;
Settings st;
Speed sp;
First fs;
//连接各信号和槽函数 实现界面切换
QObject::connect(&w,SIGNAL(emitsignal()),&d, SLOT(showing()));
QObject::connect(&w,SIGNAL(emitabout()),&ab, SLOT(showabout()));
QObject::connect(&w,SIGNAL(emitsettings()),&st, SLOT(showsettings()));
QObject::connect(&w,SIGNAL(emitspeed()),&sp, SLOT(showspeed()));
//读取ini配置文件 判断是否为首次打开
QSettings* cfg = new QSettings("Config.ini", QSettings::IniFormat);
int first = cfg->value("Use/First").toInt();
cfg->sync();
if (first==0)
{
fs.show();
}
w.show();
qApp->quit();
return a.exec();
}