-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (38 loc) · 1.04 KB
/
Copy pathmain.cpp
File metadata and controls
44 lines (38 loc) · 1.04 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
#include "StaffFaceWidget.h"
#include "StudentFaceWidget.h"
#include "LoginDialog.h"
#include "LoginedAccountSingle.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "SUEduManSys_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
LoginDialog* login = new LoginDialog;
if(login->exec() == QDialog::Accepted)
{
if(LoginedAccountSingle::instance()->getType() == ACCTYPE::STAFF)
{
StaffFaceWidget staffwid;
staffwid.show();
return a.exec();
}
else
{
StudentFaceWidget studentWid;
studentWid.show();
return a.exec();
}
}
return 0;
}