QML滚动文本区域的父级

时间:2019-12-27 18:00:41

标签: android qt qml textarea

当值达到结尾时,如何通过滚动文本区域来滚动此文本区域的父级? 它在带有qt qreator 4.9和android app target的Qt 5.12中。

Page {
    id: page 
    Flickable {
            id: flickable
            anchors.fill: parent
            anchors.margins: 5
            boundsBehavior: Flickable.OvershootBounds
            contentHeight: contentItem.childrenRect.height + 10 
            Rectangle {
                id: rect
                width: 300
                height: 200
                color: "#00000000"
                border.width: 1
                border.color: 'grey'
                radius: 5
                anchors.horizontalCenter: parent.horizontalCenter
                anchors.top: parent.top
                anchors.topMargin: 10
            }
            Flickable {
                flickableDirection: Flickable.VerticalFlick
                anchors.fill: rect
                anchors.leftMargin: 5
                anchors.rightMargin: 5
                TextArea.flickable: TextArea {
                    id: textarea
                    horizontalAlignment: Text.AlignLeft
                    wrapMode: TextEdit.WordWrap
                }
            }
    }
}

0 个答案:

没有答案
相关问题