main.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. #include <QtCore/QTimer>
  5. #include <QtGui/QApplication>
  6. #include "qmlapplicationviewer.h"
  7. #include "loadhelper.h"
  8. int main(int argc, char *argv[])
  9. {
  10. QApplication app(argc, argv);
  11. QmlApplicationViewer viewer;
  12. // Set this attribute in order to avoid drawing the system
  13. // background unnecessary.
  14. // TODO: If need be to variate this between S^3 and 5.0 devices, this will
  15. // need to be variated run-time (e.g. with QDeviceInfo::Version())!
  16. viewer.setAttribute(Qt::WA_NoSystemBackground);
  17. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  18. // First set a QML file that's quick to load and show it as a splash screen.
  19. viewer.setMainQmlFile(QLatin1String("qml/RestaurantAppComponents/SplashScreen.qml"));
  20. // Then trigger loading the *real* main.qml file, which can take longer to load.
  21. LoadHelper loadHelper(&viewer);
  22. QTimer::singleShot(1, &loadHelper, SLOT(loadMainQML()));
  23. viewer.showExpanded();
  24. return app.exec();
  25. }