Advertisement
ajith_97

main.cpp

Sep 8th, 2022
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <QApplication>
  2. #include <QQmlApplicationEngine>
  3. #include <QQmlContext>
  4. #include <QSurfaceFormat>
  5. #include <QThread>
  6.  
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10.     QApplication app(argc, argv);
  11.     QQmlApplicationEngine engine;
  12.  
  13. //    auto treeModel = new TreeModel(&engine);
  14. //    populateModel(*treeModel);
  15.  
  16. //    engine.rootContext()->setContextProperty("treeModel", treeModel);
  17.     QUrl url(QUrl::fromLocalFile("TreeViewExample/main.qml"));
  18.     engine.load(url);
  19.  
  20.     // This enforces exiting on error but works only for synchronous loads
  21.     return engine.rootObjects().empty()
  22.             && (url.isRelative() || url.scheme() == "file" || url.scheme() == "qrc")
  23.             ? 1
  24.             : app.exec();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement