Hi,
Any idea how to center the delegate item which has smaller dimensions compared to the cell dimensions?
They're always aligned on the top left.
Grid View Code:
GridView
{
id: preferencesList
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: 350; height: 350
cellWidth: 175; cellHeight: 175
delegate: delegates {}
}
GridView
{
id: preferencesList
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: 350; height: 350
cellWidth: 175; cellHeight: 175
delegate: delegates {}
}
To copy to clipboard, switch view to plain text mode
delegates:
Item
{
id: root
width: GridView.view.cellWidth
height: GridView.view.cellHeight
Rectangle
{
width: 130
height: 130
anchors.centerIn: parent.Center // this is not working
}
}
Item
{
id: root
width: GridView.view.cellWidth
height: GridView.view.cellHeight
Rectangle
{
width: 130
height: 130
anchors.centerIn: parent.Center // this is not working
}
}
To copy to clipboard, switch view to plain text mode
I already tried putting the center anchor in the root item, still not working.
Thanks.
Bookmarks