Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create spacing in Gridview

Tags:

qt

qml

I want to create a gridview in QML. Each cell consisted of one image above and text below. How can I setup space between each cell and each rows in Gridview

like image 260
KidNg Avatar asked May 19 '16 04:05

KidNg


2 Answers

You can set spacing by using cellWidth and cellHeight properties. As far as I know, there's no other spacing property.

Refer, https://forum.qt.io/topic/19775/solved-qml-gridview-and-spacing-between-children/2 for more information.

like image 125
smb564 Avatar answered Sep 20 '22 17:09

smb564


You can set GridView's cellWidth and GridView's cellHeight to some value and then inside its delegate width and height to cellWidth-8 and cellHeight-8 to get spacing.

like image 45
KernelPanic Avatar answered Sep 18 '22 17:09

KernelPanic