Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QGuiApplication>
- #include <QQmlApplicationEngine>
- #include <QQmlContext>
- #include "header.h"
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
- qmlRegisterType<MyClass>("com.example",1,0,"MyClass");
- QQmlApplicationEngine engine;
- MyClass QObject;
- const QUrl url(u"qrc:/yeppy/Main.qml"_qs);
- QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
- &app, []() { QCoreApplication::exit(-1); },
- Qt::QueuedConnection);
- engine.load(url);
- return app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement