-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (31 loc) · 914 Bytes
/
main.cpp
File metadata and controls
33 lines (31 loc) · 914 Bytes
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
#include "login.h"
#include <QSqlDatabase>
#include <QApplication>
#include "initfile.h"
#include <opencv2/opencv.hpp>
#include <QCoreApplication>
int main(int argc, char *argv[])
{
qRegisterMetaType<cv::Mat>("cv::Mat");
QApplication a(argc, argv);
//判断是否存在初始化文件若不存在启动,初始化程序
QString filePath =QApplication::applicationDirPath() + "/parkinginit.json";
QFile file(filePath);
//如果文件不能打开不存在
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
qDebug()<<"文件不存在,初始化!";
initFile *initmysql_file = new initFile;
initmysql_file->show();
file.close();
}
else
{
//文件存在启动主程序
MainWindow *w = new MainWindow;
w->show();
file.close();
w->setAttribute(Qt::WA_DeleteOnClose);
}
return a.exec();
}