[SOLVED]: ListView spacing
-
Make the delegate have 0 width, and create "real" item as its' child, but this time give it the width you desire.
-
So I tried the following:
@
Component {
id: modelDelegate
Item {
width: 0
anchors.verticalCenter: parent.verticalCenter
Text {
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
text: value
width: 100
}
}
}
@But changing the width of the child (the Text component) leads to change the position of the items.
Perhaps I miser-understood your hint? -
I think you understood well. Maybe my hint was not so good ;-) Try bumping the width to 1 - QMl engine might misinterpret width 0 as "invisible".
@
delegate: Item {
height: 1
width: 1Text {
anchors.centerIn: parent
text: value
width: 100
}
}
@ -
Yes, that will not take item collision into account, as we are fooling the ListView into thinking that the item is very small, when in reality it is not.