// SPDX-License-Identifier: GPL-3.0-or-later import QtQuick import QtQuick.Controls ListView { id: root //property alias font: textEdit.font //property alias text: textEdit.text //property alias color: textEdit.color //property alias textFormat: textEdit.textFormat //flickableDirection: Flickable.VerticalFlick //contentWidth: textEdit.width //contentHeight: textEdit.height clip: true ScrollBar.vertical: ScrollBar { parent: root.parent anchors.top: root.top anchors.right: root.right anchors.bottom: root.bottom } model: ListModel { id: logModel } delegate: TextEdit { id: textEdit text: logText width: root.width clip: true readOnly: true selectByKeyboard: true selectByMouse: true wrapMode: TextEdit.WrapAnywhere textFormat: TextEdit.RichText font.pixelSize: 16 } function append(text) { let autoScroll = atYEnd; logModel.append({ logText: text }); if (autoScroll && contentHeight > contentY + height) { contentY = contentHeight - height; } } }