-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (35 loc) · 1020 Bytes
/
Copy pathmain.cpp
File metadata and controls
41 lines (35 loc) · 1020 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
34
35
36
37
38
39
40
41
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "loginform.h"
#include "padmin.h"
#include "pmanager.h"
#include "edbconnection.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
EDBconnection* m_db;
try {
m_db = EDBconnection::getInstance();
}
catch (int error) {
qDebug("error %d (main) when try connect to DB", error);
return error;
}
catch (...) {
qDebug("unknown error (main) when try connect to DB");
return 1;
}
LoginForm loginform;
// loginform.show();
MainWindow w;
PAdmin padmin;
// PManager pmanager;
PManager pmanager;
pmanager.show();
QObject::connect(&loginform, SIGNAL(loginningUser( long )), &w, SLOT(startP( long )));
QObject::connect(&loginform, SIGNAL(loginningAdmin()), &padmin, SLOT(show()));
QObject::connect(&loginform, SIGNAL(loginningManager()), &pmanager, SLOT(startP()));
int error = a.exec();
m_db->destroyInstance();
return error;
}