前言
Qt版本:Qt6.8.0
属性
普通属性
GridView的很多属性和ListView相同参考ListView即可

cellHeight : real 每个单元格的高度(项目的占用空间)
cellWidth : real 每个单元格的宽度


flow : enumeration 决定项目排列的方向
-
GridView.LeftToRight(默认):从左到右排列。

-
GridView.TopToBottom`:从上到下排列。

附加属性
GridView.delayRemove : bool 延迟移除已滚动出视图的项目
直接使用即可
GridView.isCurrentItem : bool 用于判断某个项目是否是当前高亮的项目
直接使用即可
GridView.view : GridView 返回当前项目所属的
GridView实例
直接使用即可
附加信号
add()
pooled()
remove()
reused()
参考listview
方法
forceLayout()
int indexAt(real x, real y)
Item itemAt(real x, real y)
Item itemAtIndex(int index)
positionViewAtBeginning()
positionViewAtEnd()
positionViewAtIndex(int index, PositionMode mode)
参考listview
moveCurrentIndexDown() 将当前索引下移一行
moveCurrentIndexLeft() 将当前索引左移一列
moveCurrentIndexRight() 将当前索引右移一列
moveCurrentIndexUp() 将当前索引上移一行
PixPin_2025-05-16_10-29-29

1611

被折叠的 条评论
为什么被折叠?



