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

Text Not centred in TextField when using Style other than the Default, and shifted up.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • 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:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes