main.cpp 780 B

123456789101112131415161718192021222324252627
  1. #include <QLocale>
  2. #include <QTranslator>
  3. #include <QtGui/QApplication>
  4. #include "qmlapplicationviewer.h"
  5. Q_DECL_EXPORT int main(int argc, char *argv[])
  6. {
  7. QScopedPointer<QApplication> app(createApplication(argc, argv));
  8. // Built-in language for app is Dutch
  9. // For every other locale, use the English translation.
  10. QTranslator translator;
  11. if (QLocale::system().language() != QLocale::Dutch) {
  12. translator.load(QString("tr_en"), QString(":/"));
  13. app->installTranslator(&translator);
  14. }
  15. QmlApplicationViewer viewer;
  16. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  17. viewer.setMainQmlFile(QLatin1String("qml/buienradar/main.qml"));
  18. viewer.showExpanded();
  19. return app->exec();
  20. }