Reputation: 3035
I'm a complete newbie to QML and QT, forgive me if this is a trivial question.
I'm using the following code to center-align the text in a TextField. This does work for the placeholder text, but the entered text isn't center-aligned.
Haven't been able to figure out what I'm missing. :(
TextField {
id: pwdTF
x: 52
y: 190
z: 6
color: UbuntuColors.lightAubergine
visible: true
placeholderText: "<font color=\"LightSteelBlue\">Enter Password #</font>"
horizontalAlignment: TextInput.AlignHCenter
echoMode: TextInput.Password
}
Upvotes: 2
Views: 8293
Reputation: 451
Set the width
property. horizontalAlignment
doesn't usually work without it.
Upvotes: 3