For this, I would provide a C ++ model in QML code. Since this model will be dynamic (elements can be added or removed), I would use a derived model QAbstractItemModelthat can inform the view that some elements are added / removed. Using something else like this QList<QObject*>would mean that you would need to say that the whole model needs to be reloaded after every change.
Instead of implementing the model from scratch, you can use a class, for example QQmlObjectListModelfrom Qt QML Tricks , it provides QList- as an API from C ++, but QAbstractItemModelit displays properties QObjectas roles under the scene.
, , QObjects, benlau QSyncable ( , Window, ).
QQmlApplicationEngine setContextProperty. A QQuickView - , , , QML-.
QML- Instantiator , Window :
Instantiator {
model: yourModel
Window {
}
}