Move QAbstractItemModel QML workaround to declarativeplugin
This is necessary to fix a QML issue when running kdeconnet-app on non-Plasma desktops.
(cherry picked from commit af94100952
)
This commit is contained in:
parent
0b8fda3ab3
commit
58a400af8c
2 changed files with 7 additions and 1 deletions
|
@ -122,6 +122,13 @@ void KdeConnectDeclarativePlugin::registerTypes(const char* uri)
|
|||
return new DaemonDbusInterface;
|
||||
}
|
||||
);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
|
||||
#else
|
||||
qmlRegisterType<QAbstractItemModel>();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void KdeConnectDeclarativePlugin::initializeEngine(QQmlEngine* engine, const char* uri)
|
||||
|
|
|
@ -64,7 +64,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
KDBusService service(KDBusService::Unique);
|
||||
|
||||
qmlRegisterType<QAbstractItemModel>();
|
||||
qmlRegisterType<OurSortFilterProxyModel>("org.kde.kdeconnect.sms", 1, 0, "QSortFilterProxyModel");
|
||||
qmlRegisterType<ConversationModel>("org.kde.kdeconnect.sms", 1, 0, "ConversationModel");
|
||||
qmlRegisterType<ConversationListModel>("org.kde.kdeconnect.sms", 1, 0, "ConversationListModel");
|
||||
|
|
Loading…
Reference in a new issue