qt5-cadaques
qt5-cadaques copied to clipboard
4.7.1. Input Elements
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.