-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (22 loc) · 723 Bytes
/
Copy pathmain.cpp
File metadata and controls
27 lines (22 loc) · 723 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
#include "mainwindow.h"
#include <QApplication>
#include <QMessageBox>
#include "connection.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Connection c;
bool test=c.createconnect();
MainWindow w;
if(test)
{w.show();
QMessageBox::information(nullptr, QObject::tr("database is open"),
QObject::tr("connection successful.\n"
"Click Cancel to exit."), QMessageBox::Cancel);
}
else
QMessageBox::critical(nullptr, QObject::tr("database is not open"),
QObject::tr("connection failed.\n"
"Click Cancel to exit."), QMessageBox::Cancel);
return a.exec();
}