-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.15.1
-
None
I would like to implement switchable cell view in TableView using DelegateChooser and DelegateChoice
Switch is done by set visible property of each item but not work normally
As below code,
- Add new row and click a cell -> row 0 will be changed to Rectangle with blue color
- Add new row, several times
- row 0 Rectangle is changed back to Text and another row's cell is changed to blue color(a row is random)
- There is no log for onVisibleChanged when randomly changed
DelegateChoice {
column: 0
Rectangle {
border.width: 1
border.color: "#d7d7d7"
implicitWidth: 120
implicitHeight: 35
Rectangle {
id: colorBox
color: 'blue'
anchors.fill: parent
visible: false
onVisibleChanged: {
console.log('rectangle visible changed', row)
}
}
Text {
id: plainText
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: display
anchors.fill: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
console.log('onClicked')
colorBox.visible = true
plainText.visible = false
}
}
}
}