author | cgandhi |
Tue, 12 Oct 2010 15:23:52 +0530 | |
changeset 27 | b3e1347ac96a |
parent 26 | 83d6a149c755 |
permissions | -rw-r--r-- |
26 | 1 |
#include <QtGui/QApplication> |
2 |
#include "mainwindow.h" |
|
3 |
#include<qfile.h> |
|
4 |
#include<qtextstream.h> |
|
5 |
#ifdef Q_OS_SYMBIAN |
|
6 |
#include <eikenv.h> |
|
7 |
#include <eikappui.h> |
|
8 |
#include <aknenv.h> |
|
9 |
#include <aknappui.h> |
|
10 |
#endif |
|
11 |
||
12 |
void debugOutput(QtMsgType type, const char *msg) |
|
13 |
{ |
|
14 |
QFile logFile("c://data//SmfLog.txt"); |
|
15 |
Q_ASSERT(logFile.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append )); |
|
16 |
QTextStream stream(&logFile); |
|
17 |
||
18 |
switch (type) |
|
19 |
{ |
|
20 |
case QtDebugMsg: |
|
21 |
stream<<msg<<"\n"; |
|
22 |
break; |
|
23 |
||
24 |
case QtWarningMsg: |
|
25 |
stream<<"Warning: "; |
|
26 |
stream<<msg<<"\n"; |
|
27 |
break; |
|
28 |
||
29 |
case QtCriticalMsg: |
|
30 |
stream<<"Critical: "; |
|
31 |
stream<<msg<<"\n"; |
|
32 |
break; |
|
33 |
||
34 |
case QtFatalMsg: |
|
35 |
stream<<"Fatal: "; |
|
36 |
stream<<msg<<"\n"; |
|
37 |
break; |
|
38 |
||
39 |
default:; |
|
40 |
} |
|
41 |
} |
|
42 |
||
43 |
int main(int argc, char *argv[]) |
|
44 |
{ |
|
45 |
qInstallMsgHandler(debugOutput); |
|
46 |
QApplication a(argc, argv); |
|
47 |
MainWindow w; |
|
48 |
#ifdef Q_OS_SYMBIAN |
|
27
b3e1347ac96a
Updating the information for test applications and results.
cgandhi
parents:
26
diff
changeset
|
49 |
CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi()); |
b3e1347ac96a
Updating the information for test applications and results.
cgandhi
parents:
26
diff
changeset
|
50 |
if (appUi) { |
b3e1347ac96a
Updating the information for test applications and results.
cgandhi
parents:
26
diff
changeset
|
51 |
// Lock application orientation into landscape |
b3e1347ac96a
Updating the information for test applications and results.
cgandhi
parents:
26
diff
changeset
|
52 |
TRAPD(error,(appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait))); |
b3e1347ac96a
Updating the information for test applications and results.
cgandhi
parents:
26
diff
changeset
|
53 |
Q_UNUSED(error); |
b3e1347ac96a
Updating the information for test applications and results.
cgandhi
parents:
26
diff
changeset
|
54 |
} |
26 | 55 |
#endif |
56 |
||
57 |
||
58 |
w.showFullScreen(); |
|
59 |
return a.exec(); |
|
60 |
} |