-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
54 lines (46 loc) · 1.73 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "mainwindow.h"
#include <QApplication>
#include <QSettings>
#include <adminpanel.h>
#include <QDebug>
#include "clientpanel.h"
#include "customerpanel.h"
#include "utilities.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
utilities::sendMail();
QSettings settings("c:/windows/winf32.ini", QSettings::IniFormat);
if(settings.value("login").toBool()){
if (settings.value("role").toString() == "admin") {
adminpanel *admin = new adminpanel();
admin->setFixedSize(admin->width(),admin->height());
admin->setWindowState(Qt::WindowMaximized);
admin->setWindowTitle(" ");
admin->setWindowIcon(QIcon(":/images/icon"));
admin->show();
}else if (settings.value("role").toString() == "client") {
clientpanel *client = new clientpanel();
client->setFixedSize(client->width(),client->height());
client->setWindowState(Qt::WindowMaximized);
client->setWindowTitle(" ");
client->setWindowIcon(QIcon(":/images/icon"));
client->show();
}else{
customerPanel *customer = new customerPanel();
customer->setFixedSize(customer->width(),customer->height());
customer->setWindowState(Qt::WindowMaximized);
customer->setWindowTitle(" ");
customer->setWindowIcon(QIcon(":/images/icon"));
customer->show();
}
return a.exec();
}else{
MainWindow w;
w.setFixedSize(w.width(),w.height());
w.setWindowTitle(" ");
w.setWindowIcon(QIcon(":/images/icon"));
w.show();
return a.exec();
}
}