QML Object Repeater
The QmlObjectRepeater class implements a repeater for QObject-based
objects in QML. Unlike QQuickRepeater which only works for QtQuick items
the QmlObjectRepeater also works for non-graphical QML applications
without requiring the QtQuick module at all.
The implementation is based on QQuickRepeater and is nearly identical.
It only eliminates the QtQuick specifics and adds missing API parts
originally inherited from QQuickItem.
Copyright (c) 2018-2020 in.hub GmbH
qml_object_repeater
to the CONFIG
variable in your Qt projectRegister the QmlObjectRepeater or derived subclasses in the QML system
via qmlRegisterType():
qmlRegisterType<QmlObjectRepeater>("MyApp", 1, 0, "ObjectRepeater")
Use the repeater in your QML application
ObjectRepeater {
model: [ "Some", "model", "data" ]
MyObject {
name: "My object " + index
data: modelData
}
}
See https://doc.qt.io/qt-5/qml-qtquick-repeater.html for more details
on repeaters in general