Is it possible to dynamically remove a particular item in Repeater?
Unsolved
QML and Qt Quick
-
Hello everyone, let's say in this situation:
Column { spacing: 5 Repeater { id: repeater model: 1 delegate: Rectangle { id: rectangle color: "#000" } } Row { spacing: 5 Button { width: 100 height: 25 text: qsTr("Add") onClicked: { repeater.model+= 1; } } Button { width: 100 height: 25 text: qsTr("Remove") onClicked: { //?? } }
If one would like to use a repeater to dynamically add and remove items, how would one proceed to deleting an item in a particular index? For example, let's say I gave the remove button the index I want to remove in the repeater, when it is clicked it removes it. I have checked the documentation and I could not find any information about this.
Is this possible? If not, what alternative way can I use that does not involve dynamic object creation?
Thank you.