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
|
required property var blockSegments
|
||||||
|
|
||||||
// Reference to parent ListView for scroll control
|
// Reference to parent ListView for scroll control
|
||||||
property var chatView: null
|
property ListView parentListView: null
|
||||||
|
|
||||||
// Expand state based on block type
|
// Expand state based on block type
|
||||||
property bool blockExpanded: {
|
property bool blockExpanded: {
|
||||||
|
|
@ -150,8 +150,8 @@ ColumnLayout {
|
||||||
selectedTextColor: theme.highlightedTextColor
|
selectedTextColor: theme.highlightedTextColor
|
||||||
|
|
||||||
onActiveFocusChanged: {
|
onActiveFocusChanged: {
|
||||||
if (!activeFocus && root.chatView)
|
if (!activeFocus && root.parentListView)
|
||||||
root.chatView.interactive = true
|
root.parentListView.interactive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
|
|
@ -173,11 +173,11 @@ ColumnLayout {
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
cursorShape: Qt.IBeamCursor
|
cursorShape: Qt.IBeamCursor
|
||||||
onPressed: function(mouse) {
|
onPressed: function(mouse) {
|
||||||
if (root.chatView) root.chatView.interactive = false
|
if (root.parentListView) root.parentListView.interactive = false
|
||||||
mouse.accepted = false
|
mouse.accepted = false
|
||||||
}
|
}
|
||||||
onReleased: function(mouse) {
|
onReleased: function(mouse) {
|
||||||
if (root.chatView) root.chatView.interactive = true
|
if (root.parentListView) root.parentListView.interactive = true
|
||||||
mouse.accepted = false
|
mouse.accepted = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -279,11 +279,11 @@ ColumnLayout {
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
cursorShape: Qt.IBeamCursor
|
cursorShape: Qt.IBeamCursor
|
||||||
onPressed: function(mouse) {
|
onPressed: function(mouse) {
|
||||||
if (root.chatView) root.chatView.interactive = false
|
if (root.parentListView) root.parentListView.interactive = false
|
||||||
mouse.accepted = false
|
mouse.accepted = false
|
||||||
}
|
}
|
||||||
onReleased: function(mouse) {
|
onReleased: function(mouse) {
|
||||||
if (root.chatView) root.chatView.interactive = true
|
if (root.parentListView) root.parentListView.interactive = true
|
||||||
mouse.accepted = false
|
mouse.accepted = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -929,7 +929,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
delegate: ChatBlockDelegate {
|
delegate: ChatBlockDelegate {
|
||||||
width: chatView.width - 8
|
width: chatView.width - 8
|
||||||
chatView: chatView
|
parentListView: chatView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in New Issue