Important: Please read the Qt Code of Conduct -

How to change TextField font size

  • Hi there,

    How can I set the font size of a TextField element in QML? wanna change size of the placeholderText and also for the text which the user enters.

    I tried with a lot of ways without luck!
    @TextField {
    id: name_TextField; horizontalAlignment: Text.AlignHCenter;
    Layout.preferredWidth: parentCLayer.width * 0.90; Layout.preferredHeight: 50
    style: TextFieldStyle {
    font.pixelSize: 20 // This doesn't seem to work either
    placeholderText: qsTr("Your name here")

    It tells me that there's no member called font

  • Moderators


    Move it under TextField instead of style.

Log in to reply