-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
51 lines (45 loc) · 1.2 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
#include <QtGui/QApplication>
#include "tiltnroll.h"
//#ifdef Q_OS_SYMBIAN
//#include <QSystemInfo> //(1)
//#include <qsysteminfo.h>
//#else
//#include <QSystemInfo> //(1)
//#endif
//using namespace QtMobility; //(2)
#ifdef Q_OS_SYMBIAN
#include <eikspane.h>
#include <aknappui.h>
#include <avkon.rsg>
#include <EIKENV.H>
#include <coemain.h>
#endif
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// load Adore64 font
#ifndef Q_OS_SYMBIAN
// adding application fonts does not work under symbian...
QFontDatabase::addApplicationFont(":/fonts/Adore64.ttf");
#endif
// read stylesheet
QFile f(":/tnr.css");
if (f.open(QIODevice::ReadOnly)) {
a.setStyleSheet(f.readAll());
f.close();
}
TiltNRoll w;
#ifdef Q_OS_SYMBIAN
// lock orientation
CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
if(appUi){
QT_TRAP_THROWING(appUi ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape));
}
CEikStatusPane* statusPane = STATIC_CAST( CAknAppUi*, CEikonEnv::Static()->EikAppUi())->StatusPane();
statusPane->MakeVisible(EFalse);
w.showFullScreen();
#else
w.showFullScreen();
#endif
return a.exec();
}