mercibac

main.cpp

May 25th, 2021 (edited)
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <QGuiApplication>
  2. #include <QQmlApplicationEngine>
  3. #include <QtQml>
  4. #include "qmltranslator.h"
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.     QGuiApplication app(argc, argv);
  9.  
  10.     // Create an object to work with translations ...
  11.     QmlTranslator qmlTranslator;
  12.  
  13.     QQmlApplicationEngine engine;
  14.     // and register it as a context in Qml layer
  15.     engine.rootContext()->setContextProperty("qmlTranslator", &qmlTranslator);
  16.     engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
  17.  
  18.     return app.exec();
  19. }
Add Comment
Please, Sign In to add comment