mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
Upgrade binding loop workaround to real solution.
This commit is contained in:
parent
4d139b2991
commit
0b8e72710c
3 changed files with 7 additions and 16 deletions
|
|
@ -55,7 +55,7 @@ Rectangle {
|
|||
|
||||
ScrollBar.vertical: ForceScrollBar {
|
||||
id: scrollBar
|
||||
//policy: flickable.contentHeight > height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff // Do not use because of binding loop issues
|
||||
|
||||
contentSizeTarget: flickable.contentHeight
|
||||
sizeTarget: flickable.height
|
||||
Component.onCompleted: updatePolicy()
|
||||
|
|
|
|||
|
|
@ -12,22 +12,18 @@ ScrollBar {
|
|||
property int contentSizeTarget
|
||||
property int sizeTarget
|
||||
|
||||
onContentSizeTargetChanged: delayUpdatePolicy.restart()
|
||||
onSizeTargetChanged: delayUpdatePolicy.restart()
|
||||
onContentSizeTargetChanged: Qt.callLater( scrollBar.updatePolicy)
|
||||
onSizeTargetChanged: Qt.callLater( scrollBar.updatePolicy)
|
||||
|
||||
policy: ScrollBar.AlwaysOff
|
||||
function updatePolicy(){
|
||||
policy = contentSizeTarget > sizeTarget ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
}
|
||||
function delayPolicy(){
|
||||
delayUpdatePolicy.restart()
|
||||
Qt.callLater( scrollBar.updatePolicy)
|
||||
}
|
||||
Component.onCompleted: updatePolicy()
|
||||
Timer{// Delay to avoid binding loops
|
||||
id:delayUpdatePolicy
|
||||
interval:10
|
||||
onTriggered: scrollBar.updatePolicy()
|
||||
}
|
||||
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
|
|
@ -133,13 +133,8 @@ Item {
|
|||
model: ContentProxyModel{
|
||||
chatMessageModel: mainItem.chatMessageModel
|
||||
}
|
||||
Timer{// Delay to avoid binding loops
|
||||
id:delayUpdate
|
||||
interval:10
|
||||
onTriggered: replyMessage.height = replyMessage.contentHeight
|
||||
}
|
||||
onContentHeightChanged: delayUpdate.restart()
|
||||
//height: contentHeight
|
||||
|
||||
onContentHeightChanged: Qt.callLater( function(){replyMessage.height = replyMessage.contentHeight})
|
||||
|
||||
delegate: ChatContent{
|
||||
contentModel: $modelData
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue