MixedView/main.cpp
author John Kern <johnk@symbian.org>
Mon, 25 Oct 2010 10:35:32 -0700
changeset 3 2e16639599b7
parent 0 061910b224a4
permissions -rw-r--r--
flipping cards example
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     1
#include <QtGui/QApplication>
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     2
#include "mainwindow.h"
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     3
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     4
// Needed Symbian specific headers
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     5
#ifdef Q_OS_SYMBIAN
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     6
#include <eikenv.h>
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     7
#include <eikappui.h>
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     8
#include <aknenv.h>
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
     9
#include <aknappui.h>
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    10
#include <coeaui.h>
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    11
#endif
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    12
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    13
int main(int argc, char *argv[])
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    14
{
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    15
    QApplication a(argc, argv);
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    16
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    17
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    18
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    19
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    20
    MainWindow w;
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    21
    a.installEventFilter(&w);
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    22
    w.setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    23
3
2e16639599b7 flipping cards example
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    24
    // Symbian specific code to keep the screen orientation of the game in Portrait mode.
0
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    25
#ifdef Q_OS_SYMBIAN
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    26
    CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    27
    if(appUi){
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    28
      TRAP_IGNORE( appUi->SetOrientationL( CAknAppUi::EAppUiOrientationPortrait ) );
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    29
    }
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    30
#endif
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    31
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    32
#if defined(Q_WS_S60)
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    33
    w.showMaximized();
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    34
#else
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    35
    w.show();
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    36
#endif
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    37
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    38
    return a.exec();
061910b224a4 Adding mixedview project
Wesley Thierry <wesleyt@symbian.org>
parents:
diff changeset
    39
}