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

Native TextField: placeholderText does not respect horizontalAlignment

    XMLWordPrintable

Details

    • macOS, Windows
    • e3f990999b (qt/qtdeclarative/dev) e3f990999b (qt/tqtc-qtdeclarative/dev) 85312110d7 (qt/qtdeclarative/6.3) 85312110d7 (qt/tqtc-qtdeclarative/6.3) ab10e565f0 (qt/tqtc-qtdeclarative/6.2)

    Description

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import QtQuick.Window 2.15
      
      Window {
          visible: true
      
          width: 300
          height: 300
      
          TextField {
              width: 200
              anchors.centerIn: parent
      
              horizontalAlignment: Text.AlignHCenter
              placeholderText: "Centered"
          }
      }
      

      See attached screenshots.

      • Expected outcome: Window should look like textfield-placeholder-centered.png
      • Actual outcome: Window looks like textfield-placeholder-notcentered.png

       

      Notes

      • The issue affects TextField.placeholderText in Qt 6 in native style
      • The issue does not affect TextField.text
      • The issue does not affect Qt 5

       

      Workaround

      Switch to a different style, like Basic or Fusion

      Attachments

        Issue Links

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

          Activity

            People

              hatemelkharashy Hatem ElKharashy
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes