В моем приложении я добавил простой TextArea
. К сожалению, я не могу прокручивать текст, даже если его contentHeight
обходит его height
.
Вот код:QML TextArea не будет прокручиваться
import QtQuick 2.7
import QtQuick.Controls 2.0
ApplicationWindow {
id: appWindow
visible: true
width: 480
height: 640
TextArea{
anchors.fill: parent
anchors.margins: 100
wrapMode: TextEdit.Wrap
Component.onCompleted: {
console.log("width:", width)
console.log("contentWidth:", contentWidth)
console.log("height:", height)
console.log("contentHeight:", contentHeight)
}
onTextChanged: {
console.log("width:", width)
console.log("contentWidth:", contentWidth)
console.log("height:", height)
console.log("contentHeight:", contentHeight)
}
}
}
Я изначально хотел сделать это с помощью метки, которая получает предопределенный текст с моего сервера. Даже если вы используете Flickable, я не могу прокручивать ярлык:/ –
Можете ли вы включить код для «Ярлыки» в «Flickable», который я могу прокрутить в вашем ответе? –
Привязать 'Flickable :: contentHeight' к высоте метки. – jpnurmi