It works okay for the Flickable (i.e. Flickable with Grid and same Rectangles (see code below) in it).
Here's an example for GridView:
import QtQuick 2.7
import QtQuick.Controls 1.4
ApplicationWindow {
id: rootWindow
visible: true
width: 300
height: 300
Rectangle {
anchors.fill: parent
color: "yellow"
GridView {
id: gridView
anchors.fill: parent
cellWidth: 50
cellHeight: 50
model: 54
bottomMargin: 10
topMargin: 10
leftMargin: 10 // this doesn't work
rightMargin: 10 // this doesn't work
delegate: Rectangle {
width: gridView.cellWidth - 1
height: gridView.cellHeight - 1
color: "green"
}
}
}
}
Maybe thats what you are looking for:
...
GridView {
id: gridView
anchors {
fill: parent
margins: 10
}
clip: true
cellWidth: 50
cellHeight: 50
model: 54
delegate: Rectangle {
width: gridView.cellWidth - 1
height: gridView.cellHeight - 1
color: "green"
}
}
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With