diff --git a/discover/DiscoverDeclarativePlugin.cpp b/discover/DiscoverDeclarativePlugin.cpp --- a/discover/DiscoverDeclarativePlugin.cpp +++ b/discover/DiscoverDeclarativePlugin.cpp @@ -55,7 +55,6 @@ void DiscoverDeclarativePlugin::registerTypes(const char* /*uri*/) { qmlRegisterType("org.kde.discover", 2, 0, "TransactionListener"); - qmlRegisterType(); qmlRegisterType("org.kde.discover", 2, 0, "ResourcesUpdatesModel"); qmlRegisterType("org.kde.discover", 2, 0, "ResourcesProxyModel"); @@ -72,11 +71,21 @@ qmlRegisterUncreatableType("org.kde.discover", 2, 0, "Transaction", QStringLiteral("should come from the backends")); qmlRegisterUncreatableType("org.kde.discover", 2, 0, "SourcesModelClass", QStringLiteral("should come from the backends")); qmlRegisterUncreatableType("org.kde.discover", 2, 0, "AbstractBackendUpdater", QStringLiteral("should come from the backends")); +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); +#else + qmlRegisterAnonymousType("org.kde.discover", 1); + qmlRegisterAnonymousType("org.kde.discover", 1); + qmlRegisterAnonymousType("org.kde.discover", 1); + qmlRegisterAnonymousType("org.kde.discover", 1); + qmlRegisterAnonymousType("org.kde.discover", 1); + qmlRegisterAnonymousType("org.kde.discover", 1); +#endif qmlProtectModule("org.kde.discover", 2); qRegisterMetaType>(); } diff --git a/discover/DiscoverObject.cpp b/discover/DiscoverObject.cpp --- a/discover/DiscoverObject.cpp +++ b/discover/DiscoverObject.cpp @@ -123,13 +123,24 @@ connect(r, &DiscoverSettings::appsListPageSortingChanged, r, &DiscoverSettings::save); return r; }); +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); +#else + qmlRegisterAnonymousType("org.kde.discover.app", 1); + qmlRegisterAnonymousType("org.kde.discover.app", 1); + qmlRegisterAnonymousType("org.kde.discover.app", 1); + + qmlRegisterAnonymousType("org.kde.discover.app", 1); + qmlRegisterAnonymousType("org.kde.discover.app", 1); + qmlRegisterAnonymousType("org.kde.discover.app", 1); +#endif + qmlRegisterUncreatableType("org.kde.discover.app", 1, 0, "DiscoverMainWindow", QStringLiteral("don't do that")); setupActions();