PDA

View Full Version : remove rows loop in qml



ravandi
25th March 2016, 18:05
how to remove rows in loop?
like this video:
11810

my code:

import QtQuick 2.0

Rectangle {
id: base;
width:600;
height: 800;

Column {
spacing: 5;

Repeater {
model: 5;
delegate: Rectangle {
width: 100;
height: 20;
color: "white";
border { width: 1; color: "black" }
radius: 3;

Image
{
id: hazf
source: "pic/hazf.gif"
width:20
height:20
}

}
}
}
}

anda_skoa
26th March 2016, 11:35
You just decrement your model value.

Cheers,
_

ravandi
27th March 2016, 14:43
no,The rectangles are not the same,Each has a name.
11815

anda_skoa
27th March 2016, 14:51
Then the code you've posted is not the code you are using.

But the general idea still stands: remove the entry from the model, the repeater will remove the delegate instance

Cheers,
_