1
私のアプリケーションには簡単な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)
}
}
}
私は当初、自分のサーバーから事前に定義されたテキストを取得するLabelを使ってこれをやりたかったのです。 Flickableを使用していても、ラベルをスクロールすることはできません:/ –
あなたの答えでスクロールできる 'Flickable'に' Label'のコードを含めてください。 –
Flickable :: contentHeightをラベルの高さにバインドします。 – jpnurmi