Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QApplication>
- #include <QQmlApplicationEngine>
- #include <QQmlContext>
- #include <QSurfaceFormat>
- #include <QThread>
- int main(int argc, char *argv[])
- {
- QApplication app(argc, argv);
- QQmlApplicationEngine engine;
- // auto treeModel = new TreeModel(&engine);
- // populateModel(*treeModel);
- // engine.rootContext()->setContextProperty("treeModel", treeModel);
- QUrl url(QUrl::fromLocalFile("TreeViewExample/main.qml"));
- engine.load(url);
- // This enforces exiting on error but works only for synchronous loads
- return engine.rootObjects().empty()
- && (url.isRelative() || url.scheme() == "file" || url.scheme() == "qrc")
- ? 1
- : app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement