나는 GridLayout 에 의해 채워 Repeater(a TableView 에 맞지 않는 내가 필요),내부 Flickable 그래서 스크롤 할 수 있습니다.
내 GridLayout 헤더를 포함할 수 있습니 쉽게 추가하여 Text
s 기 전에 내 Repeater 다음과 같다:
import QtQuick 2.0
import QtQuick.Layouts 1.12
ColumnLayout {
width: 200
height: 200
Flickable {
Layout.fillWidth: true
Layout.preferredHeight: 200
contentWidth: width
contentHeight: grid.height
clip: true
GridLayout {
id: grid
columns: 3
columnSpacing: 10
function reparentChildren(source, target) {
while (source.children.length) {
source.children[0].parent = target;
}
}
// Header
Text {
text: "Header 0"
}
Text {
text: "Header 1"
}
Text {
text: "Header 2"
}
// Data
Repeater {
model: 50
Item {
Component.onCompleted: grid.reparentChildren(this, grid)
Text {
text: "Column 0, %1".arg(modelData)
}
Text {
text: "Column 1, %1".arg(modelData)
}
Text {
text: "Column 2, %1".arg(modelData)
}
}
}
}
}
}
그러나 나는 나의 헤더를"끈끈한"/"frozen",즉 유지 보이는 경우 스크롤 Flickable. 를 만들 수 있었 내 헤더외 Flickable,그러나 GridLayout 지 않는 나에게 최종 행 크기,그래서 내가 수치 헤더니다.