StatusQ: Workaround for QTBUG-86428

Registration of QAbstractItemModel* allows to nest submodels, e.g:

SortFitlerProxyModel {
    sourceModel: LeftJoinModel { ... }
}

Earlier, it would cause error:
> Cannot assign to property of unknown type "QAbstractItemModel*"
This commit is contained in:
Michał Cieślak 2024-07-03 13:31:26 +02:00 committed by Michał
parent 84ac6e5902
commit 670aa4627e
1 changed files with 3 additions and 0 deletions

View File

@ -75,6 +75,9 @@ public:
qmlRegisterUncreatableType<ModelCount>("StatusQ", 0, 1,
"ModelCount", "This is attached type, cannot be created directly.");
// Workaround for https://bugreports.qt.io/browse/QTBUG-86428
qmlRegisterAnonymousType<QAbstractItemModel>("StatusQ", 1);
qmlRegisterSingletonType<ModelUtilsInternal>(
"StatusQ.Internal", 0, 1, "ModelUtils", &ModelUtilsInternal::qmlInstance);