From af941009526f7c9b2aa9093b57746f1e022f729b Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 14 Mar 2020 16:44:11 +0100 Subject: [PATCH] Move QAbstractItemModel QML workaround to declarativeplugin --- declarativeplugin/kdeconnectdeclarativeplugin.cpp | 7 +++++++ smsapp/main.cpp | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/declarativeplugin/kdeconnectdeclarativeplugin.cpp index ad8717e0d..d2f808167 100644 --- a/declarativeplugin/kdeconnectdeclarativeplugin.cpp +++ b/declarativeplugin/kdeconnectdeclarativeplugin.cpp @@ -122,6 +122,13 @@ void KdeConnectDeclarativePlugin::registerTypes(const char* uri) return new DaemonDbusInterface; } ); + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + qmlRegisterAnonymousType(uri, 1); +#else + qmlRegisterType(); +#endif + } void KdeConnectDeclarativePlugin::initializeEngine(QQmlEngine* engine, const char* uri) diff --git a/smsapp/main.cpp b/smsapp/main.cpp index 66efcc98c..9b9af7033 100644 --- a/smsapp/main.cpp +++ b/smsapp/main.cpp @@ -62,7 +62,6 @@ int main(int argc, char *argv[]) KDBusService service(KDBusService::Unique); - qmlRegisterType(); qmlRegisterType("org.kde.kdeconnect.sms", 1, 0, "QSortFilterProxyModel"); qmlRegisterType("org.kde.kdeconnect.sms", 1, 0, "ConversationModel"); qmlRegisterType("org.kde.kdeconnect.sms", 1, 0, "ConversationListModel");