main.cpp 526 B

12345678910111213141516171819202122
  1. #include <QApplication>
  2. #include <QQmlEngine>
  3. #include <QQuickView>
  4. #include <QQmlContext>
  5. #include <githandler.h>
  6. #include <QDebug>
  7. int main(int argc, char *argv[])
  8. {
  9. QApplication app(argc, argv);
  10. QQuickView view;
  11. qmlRegisterUncreatableType<GitHandler>("org.semlanik.nicegit", 1, 0, "GitHandler", "Global for qml");
  12. GitHandler handler;
  13. view.rootContext()->setContextProperty("_handler", &handler);
  14. view.setSource(QUrl("qrc:/qml/MainView.qml"));
  15. view.showMaximized();
  16. return app.exec();
  17. }