0
我在我的qml代码中使用GridView,但它只显示一行中的所有项目,但我不想要它。您可以在下面的图片中看到: ,这是我的代码:为什么GridView项目不包装?
import QtQuick 2.8
import QtQuick.Controls 2.1
import Qt.labs.folderlistmodel 2.1
ApplicationWindow{
id: a
width: 480
height: 640
FolderListModel{
id : listModel
folder: "/home/muhammad/Pictures"
nameFilters: ["*.jpg"]
}
Component{
id: dd
Image {
id: m
width: a.width/3
height: width
source: filePath
}
}
GridView{
verticalLayoutDirection: GridView.TopToBottom
layoutDirection: Qt.LeftToRight
anchors.fill: parent
flow: GridView.FlowLeftToRight
model: listModel
delegate: dd
}
}
我该怎么解决呢?
在此先感谢!有用! ;) –