main.cpp 771 B

123456789101112131415161718192021222324252627282930313233
  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3. #ifdef Q_WS_MAEMO_5
  4. #include <QtOpenGL/QGLWidget>
  5. #endif
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication app(argc, argv);
  9. QmlApplicationViewer viewer;
  10. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
  11. viewer.setMainQmlFile(QLatin1String("qml/RestaurantAppPano/main.qml"));
  12. // For N900 set OpenGL rendering
  13. #ifdef Q_WS_MAEMO_5
  14. QGLFormat fmt = QGLFormat::defaultFormat();
  15. fmt.setDoubleBuffer(true);
  16. QGLWidget *glWidget = new QGLWidget(fmt);
  17. viewer.setViewport(glWidget);
  18. #endif
  19. #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) || defined(QT_SIMULATOR)
  20. viewer.showFullScreen();
  21. #else
  22. viewer.show();
  23. #endif
  24. return app.exec();
  25. }