qt5-cadaques icon indicating copy to clipboard operation
qt5-cadaques copied to clipboard

4.7.1. Input Elements

Open PenguinHeart opened this issue 10 years ago • 0 comments

back-link: ch04/index.html#textinput

In 4.7.1, TLineEditV1.qml has a Rectangle that inherits from its TextInput, which also inherits from its parent. It is a loop that causes the display of the text box to be 0 + 8.

Corrected code would be:

import QtQuick 2.0

Rectangle {
    width: inputField.width + inputField.height; height: inputField.height + 8
    color: "lightsteelblue"
    border.color: "gray"

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

    TextInput {
        id: inputField
        anchors.centerIn: parent
        focus: true
        text: "Height " + height
        width: 96
    }
}

Hopefully this helps.

PenguinHeart avatar Feb 04 '15 23:02 PenguinHeart