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

Text inside of TextInput is rendered on top and beyond the border even with specified padding

    XMLWordPrintable

Details

    Description

      The TextInput has the issue that the text is extending over the border on the left side by one pixel and on the right side by at least 3 pixels. Even if the left and right padding are set, it is only showing when scrolling fully to the left or right.

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12
      
      Window {
          visible: true
          width: 640
          height: 480
          color: "#606060"
      
          TextInput {
              id: textInput
              anchors.centerIn: parent
              z: 2
              width: 280
              height: 60
              horizontalAlignment: Qt.AlignHCenter
              verticalAlignment: Qt.AlignVCenter
              readOnly: false
              selectByMouse: false
              activeFocusOnPress: false
              clip: true
              font.pixelSize: 48
              color: "white"
              text: "This is it!#"
              leftPadding: 40
              rightPadding: 40
      
              Rectangle {
                  id: textInputArea
                  color: "grey"
                  border.color: "black"
                  border.width: 1
                  x: 0
                  y: 0
                  z: -1
                  width: textInput.width
                  height: textInput.height
              }
      
              TapHandler {
                  id: tapHandler
                  acceptedDevices: PointerDevice.Mouse
                  enabled: true
                  onTapped: textInput.forceActiveFocus()
              }
          }
      }
      

      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
              henning Henning Gründl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes