SmartLockerTools/Analyser/qml/LogView.qml
amass 8fa26363b7
Some checks failed
Build Applications / PullDocker (push) Successful in 3s
Build Applications / Build (push) Failing after 26s
Windows CI / build (push) Failing after 52s
add simple log view.
2024-11-05 00:23:54 +08:00

33 lines
591 B
QML

import QtQuick
ListView {
id: root
model: ListModel {
id: logModel
ListElement {
message: ""
}
}
delegate: Text {
width: ListView.view.width
text: message
wrapMode: Text.Wrap
}
function append(message){
let item = {
message: message
};
logModel.append(item)
if(root.atYEnd){
Qt.callLater(()=>{
root.positionViewAtEnd() })
}
}
function clear(){
logModel.clear()
}
}