main.cpp 784 B

12345678910111213141516171819202122232425262728293031
  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3. #include "meewordsdata.h"
  4. #include <QTranslator>
  5. #include <QLocale>
  6. Q_DECL_EXPORT int main(int argc, char *argv[])
  7. {
  8. QScopedPointer<QApplication> app(createApplication(argc, argv));
  9. QTranslator trans;
  10. QLocale lcl;
  11. QmlApplicationViewer viewer;
  12. if(lcl.language() == QLocale::Russian) {
  13. trans.load( "/opt/MeeWords/qml/MeeWords/i18n/meewords_rus.qm" );
  14. app->installTranslator( &trans );
  15. }
  16. MeeWordsData myData;
  17. viewer.rootContext()->setContextProperty("cppMeeWords", &myData);
  18. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  19. viewer.setMainQmlFile(QLatin1String("qml/MeeWords/main.qml"));
  20. viewer.showExpanded();
  21. return app->exec();
  22. }