TreeView's item delegate receiving empty strings as styleData.value
QML and Qt Quick
1
Posts
1
Posters
898
Views
1
Watching
-
Hi,
I noticed a weird behavior of the delegates in TreeView's and TreeViewColumn's : the styleData.value sometimes is an empty string, no matter the type of the item it should receive.
For instance, if you take the 'Qt Qui Controls - File System Browser' example, and you modify slightly the the Name column:
TableViewColumn { title: "Name" role: "fileName" resizable: true delegate: Text { text: { console.log(this, styleData.value); return styleData.value; } } }It will output the following:
qml: QQuickText(0xb30c310) C: qml: QQuickText(0xb30c310) C: qml: QQuickText(0xb303090) qml: QQuickText(0xb303090) G: qml: QQuickText(0x59e82f0) qml: QQuickText(0x59e82f0) E: qml: QQuickText(0x4b89250) qml: QQuickText(0x4b89250) D: qml: QQuickText(0xb30c310) C: qml: QQuickText(0xb303090) G: qml: QQuickText(0x59e82f0) E: qml: QQuickText(0x4b89250) D:It doesn't really make sense to me ... why would the delegate corresponding to my
C:item be called 3 times with the correctfileNamewhile the delegate for theG:drive is called once with an empty string, and twice with the correctfileName?Any idea what's going on ?