-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
42 lines (33 loc) · 1.03 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
#include "mainwindow.h"
#include <QApplication>
#include <QInputDialog>
#include <QTranslator>
#include <QStringList>
#include <QScreen>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QRect rec = a.primaryScreen()->geometry();
int height = rec.height();
int width = rec.width();
QTranslator t;
QStringList Languages;
Languages << "English" << "Русский" << "Română";
QString Lang = QInputDialog::getItem(NULL, "Select Language","Language",Languages);//created a dialog window
// Chose language
if(Lang == "English")
if( t.load(":/translation/English.qm"))
a.installTranslator(&t);
if (Lang == "Русский")
if(t.load(":/translation/Russia.qm"))
a.installTranslator(&t);
if (Lang == "Română")
if(t.load(":/translation/Romanian.qm"))
a.installTranslator(&t);
MainWindow w;
//set window size
w.setMinimumWidth(width*0.25);
w.setMinimumHeight(height*0.25);
w.show();
return a.exec();
}