#include #include #include #include #include #include #include #include #include #include #include #include #include #include "quickeventservice.h" QTMVVM_REGISTER_CORE_APP(SampleCoreApp) int main(int argc, char *argv[]) { #ifdef QML_PATH qputenv("QML2_IMPORT_PATH", QML_PATH); #endif QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); qDebug() << QQuickStyle::availableStyles() << QQuickStyle::name(); coreApp->setShowDrawer(true); qmlRegisterUncreatableType("de.skycoder42.QtMvvm.Sample", 1, 0, "SampleViewModel", QStringLiteral("ViewModels cannot be created")); qmlRegisterUncreatableType("de.skycoder42.QtMvvm.Sample", 1, 0, "ResultViewModel", QStringLiteral("ViewModels cannot be created")); qmlRegisterUncreatableType("de.skycoder42.QtMvvm.Sample", 1, 0, "DrawerViewModel", QStringLiteral("ViewModels cannot be created")); qmlRegisterUncreatableType("de.skycoder42.QtMvvm.Sample", 1, 0, "TabViewModel", QStringLiteral("ViewModels cannot be created")); qmlRegisterUncreatableType("de.skycoder42.QtMvvm.Sample", 1, 0, "TabItemViewModel", QStringLiteral("ViewModels cannot be created")); QtMvvm::ServiceRegistry::instance()->registerObject(); QtMvvm::ServiceRegistry::instance()->registerInterface(); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); }