qmlbook / qt6book

The Qt 6 Book - A book about QML
https://www.qt.io/product/qt6/qml-book
Other
342 stars 112 forks source link

TextInput.height binding not work. #154

Open Honghe opened 2 years ago

Honghe commented 2 years ago
// TLineEditV2.qml

import QtQuick

FocusScope {
    width: 96; height: input.height + 8
    Rectangle {
        anchors.fill: parent
        color: "lightsteelblue"
        border.color: "gray"

    }

    property alias text: input.text
    property alias input: input

    TextInput {
        id: input
        anchors.fill: parent
        anchors.margins: 4
        focus: true
    }
}
//TextInputExample4.qml

Rectangle {
    ...
    TLineEditV1 {
        id: input1
        ...
    }
    TLineEditV1 {
        id: input2
        ...
    }
}

Expected: image

Actually: image