-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
56 lines (45 loc) · 1.12 KB
/
Copy pathmain.cpp
File metadata and controls
56 lines (45 loc) · 1.12 KB
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
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "loginform.h"
#include "edbconnection.h"
//#include "esupplier.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
EDBconnection* m_db;
try {
m_db = EDBconnection::getInstance();
}
catch (int error) {
qDebug("error (main) when try connect to DB");
return error;
}
catch (...) {
qDebug("error (main) when try connect to DB");
return 1;
}
LoginForm login;
MainWindow w;
QObject::connect(&login, SIGNAL(loginning(long)), &w, SLOT(startP(long)));
QObject::connect(&w, SIGNAL(exitWorkplace()), &login, SLOT(show()));
login.show();
// test supplier
// EUser user(19);
// ESupplier supplier(user);
// supplier.show();
// test client
// EUser user(5);
// EClient client(user);
// client.show();
// test operator
// EUser user(23);
// EOperator e_operator(user);
// e_operator.show();
// test admin
// EUser user(24);
// EAdmin admin(user);
// admin.show();
int r_code = a.exec();
delete m_db;
return r_code;
}