qml: fix binding loop in ChatBlockDelegate
Rename 'chatView' property to 'parentListView' to avoid name collision with the ListView id, which caused QML binding loop warnings.
This commit is contained in:
parent
60c273e94a
commit
073cc2158b
|
|
@ -13,7 +13,7 @@ ColumnLayout {
|
|||
required property var blockSegments
|
||||
|
||||
// Reference to parent ListView for scroll control
|
||||
property var chatView: null
|
||||
property ListView parentListView: null
|
||||
|
||||
// Expand state based on block type
|
||||
property bool blockExpanded: {
|
||||
|
|
@ -150,9 +150,9 @@ ColumnLayout {
|
|||
selectedTextColor: theme.highlightedTextColor
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if (!activeFocus && root.chatView)
|
||||
root.chatView.interactive = true
|
||||
}
|
||||
if (!activeFocus && root.parentListView)
|
||||
root.parentListView.interactive = true
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: contextMenu
|
||||
|
|
@ -173,11 +173,11 @@ ColumnLayout {
|
|||
propagateComposedEvents: true
|
||||
cursorShape: Qt.IBeamCursor
|
||||
onPressed: function(mouse) {
|
||||
if (root.chatView) root.chatView.interactive = false
|
||||
if (root.parentListView) root.parentListView.interactive = false
|
||||
mouse.accepted = false
|
||||
}
|
||||
onReleased: function(mouse) {
|
||||
if (root.chatView) root.chatView.interactive = true
|
||||
if (root.parentListView) root.parentListView.interactive = true
|
||||
mouse.accepted = false
|
||||
}
|
||||
}
|
||||
|
|
@ -279,11 +279,11 @@ ColumnLayout {
|
|||
propagateComposedEvents: true
|
||||
cursorShape: Qt.IBeamCursor
|
||||
onPressed: function(mouse) {
|
||||
if (root.chatView) root.chatView.interactive = false
|
||||
if (root.parentListView) root.parentListView.interactive = false
|
||||
mouse.accepted = false
|
||||
}
|
||||
onReleased: function(mouse) {
|
||||
if (root.chatView) root.chatView.interactive = true
|
||||
if (root.parentListView) root.parentListView.interactive = true
|
||||
mouse.accepted = false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -929,7 +929,7 @@ ApplicationWindow {
|
|||
|
||||
delegate: ChatBlockDelegate {
|
||||
width: chatView.width - 8
|
||||
chatView: chatView
|
||||
parentListView: chatView
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in New Issue