Skip to content

Commit

Permalink
PingLogger: Use count from LogListModel to update viewer position
Browse files Browse the repository at this point in the history
Fix #337

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric authored and jaxxzer committed Nov 16, 2018
1 parent 37afd7b commit 1263e66
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions qml/PingLogger.qml
Expand Up @@ -52,12 +52,11 @@ Item {
ScrollBar.horizontal: ScrollBar { }
ScrollBar.vertical: ScrollBar { }

onCountChanged: {
if(scrollLockEnabled) {
// This appears to be better than positionViewAtEnd
// Less bug
positionViewAtIndex(count - 1, ListView.Beginning)
}
// After we moved from StringListModel to our own "QQmlListModel"
// We forgot to add the count signal to be able to do the scroll lock
Connections {
target: Logger.logModel
onCountChanged: listView.currentIndex = listView.count - 1
}
}
}

0 comments on commit 1263e66

Please sign in to comment.