Я просто пытаюсь создать TableView в своем файле QML, например, так:
TableView {
id: resultListTableView
anchors.fill: parent
rowDelegate: Rectangle {
color: "#D3D3D3"
height: 30
}
itemDelegate: Rectangle {
width: 100
height: 50
border.color: "#000000"
border.width: 1
Text {
id: textItem
text: styleData.value
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
}
}
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
elide: Text.ElideRight
}
}
TableViewColumn {
role: "file"
title: "File"
width: resultListTableView.viewport.width * 0.3
movable: false
resizable: false
}
TableViewColumn {
role: "type"
title: "Type"
width: resultListTableView.viewport.width * 0.2
movable: false
resizable: false
}
TableViewColumn {
role: "size"
title: "Size"
width: resultListTableView.viewport.width * 0.2
movable: false
resizable: false
}
TableViewColumn {
role: "path"
title: "Path"
width: resultListTableView.viewport.width * 0.3
movable: false
resizable: false
}
model: ResultListDataModel {}
onDoubleClicked: {
const element = model.get(row)
console.log("Downloading file ", element.file, "of size", element.size)
}
}
Этот компонент является частью TabView и отображается при нажатии на соответствующую вкладку. Когда щелкают по вкладке, я случайно получаю предупреждение цикла привязки:
QML TableView: Binding loop detected for property "__scrollBarTopMargin"
Я не делаю ничего, что может привести к этому циклу привязки, поэтому мне интересно, гдепроблема в том. Кто-нибудь знает, что здесь происходит?