Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96885

Text Not centred in TextField when using Style other than the Default.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.2.3
    • Quick: Controls 2
    • None
    • Windows 10
      Android API 27, 30
      IOS emulator
      MacOS 13.0
    • Android, iOS/tvOS/watchOS, macOS, Windows

    Description

      Text not centered inside the TextField when using Style other than the default (Material, Universal, and others)

       
        TextField {
      id: usernameTextField
      placeholderText: qsTr("username")
      width: 250
      height: 40
      anchors

      { top: parent.top topMargin: giveDetailsLabel.anchors.topMargin + 36 horizontalCenter: parent.horizontalCenter horizontalCenterOffset: 0 }

      background: Rectangle {
      radius: 20
      border.color: "#C9C9C9"
      border.width: 1
      }
      verticalAlignment: TextField.AlignVCenter

      font.pixelSize: 16
      font.weight: Font.Normal
      font.family: "Open Sans"
      leftPadding: 10
      }
      {{ }}

      {{}}

      QT fourm link for images, i can't upload image here

      https://forum.qt.io/topic/130579/text-not-in-the-center-of-textfield-when-creating-a-rounded-textfield

       

      Thank you.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              amrcoder amr kamal
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes