SmartLockerTools/Analyser/qml/LogView.qml
luocai 881048a286
All checks were successful
Build Applications / PullDocker (push) Successful in 3s
Build Applications / Build (push) Successful in 5m14s
Windows CI / build (push) Successful in 8m3s
reset module before ota.
2024-11-08 18:26:33 +08:00

35 lines
648 B
QML

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