-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cxx
43 lines (32 loc) · 1.21 KB
/
Main.cxx
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
#include "ApplicationTut.h"
#include <QApplication>
#include <QTranslator>
int main ( int argc, char* argv[] )
{
QApplication a( argc, argv );
QString resDir = ApplicationCommonWindow::getResourceDir();
QString resTutDir = ApplicationTut::getTutResourceDir();
QTranslator strTrans( 0 );
Standard_Boolean isOK = strTrans.load( "Common-string", resDir );
if( isOK )
a.installTranslator( &strTrans );
QTranslator iconTrans( 0 );
isOK = iconTrans.load( "Common-icon", resDir );
if( isOK )
a.installTranslator( &iconTrans );
QTranslator strTutTrans( 0 );
isOK = strTutTrans.load( "Tutorial-string", resTutDir );
if( isOK )
a.installTranslator( &strTutTrans );
QTranslator iconTutTrans( 0 );
isOK = iconTutTrans.load( "Tutorial-icon", resTutDir );
if( isOK )
a.installTranslator( &iconTutTrans );
QObject::connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
ApplicationTut* mw = new ApplicationTut();
mw->setWindowTitle( QObject::tr( "TIT_SAMPLE" ) );
QString aResName( resDir + QString( "/" ) + QObject::tr( "ICON_SAMPLE" ) );
mw->setWindowIcon( QPixmap( aResName ) );
mw->show();
return a.exec();
}