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

TextArea/TextField: placeholderText does not respect horizontalAlignment after the component creation

    XMLWordPrintable

Details

    • macOS
    • 694a67753 (dev), 8b12eb7ed (6.7), 8903bb3d6 (6.6), ffbcbec9e (tqtc/lts-6.5)

    Description

      TextArea/TextField: placeholderText does not respect horizontalAlignment after the component creation. There is no such problem if horizontalAlignment is set initially.

      Code sample:

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Window
      
      Window {
          width: 300
          height: 300
          visible: true
      
          Column {
              Button {
                  text: "Align Left"
                  onClicked: {
                      textArea.horizontalAlignment = TextArea.AlignLeft
                      textField.horizontalAlignment = TextField.AlignLeft
                  }
              }
      
              TextArea {
                  id: textArea
                  width: 200
                  placeholderText: "שלום"
                  background: Rectangle { border.width: 1 }
              }
      
              TextField {
                  id: textField
                  width: 200
                  placeholderText: "שלום"
                  background: Rectangle { border.width: 1 }
              }
          }
      }
      

      Steps to reproduce:
      1. Run the code sample above
      2. Observe placeholder text - aligned to the Right (implicitly), since the text is RTL - OK
      3. Press Align Left button.
      4. Observe placeholder text - still aligned to the Right, but should be aligned to the Left, since the alignment was set explicitly - BUG

       

      Attachments

        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
            studiosus Vladimir Belyavsky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes