Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-329

Text.horizontalAlignment is not honoured by auto-wrapped text

    XMLWordPrintable

Details

    • Consumer team Sprint 2024/3.1, Consumer team Sprint 2024/3.2

    Description

      Code

      import QtQuick
      
      Column {
          Rectangle {
              width: 200
              height: 100
              anchors.centerIn: parent
              color: "red"
              Text {
                  anchors.fill: parent
                  wrapMode: Text.Wrap
                  horizontalAlignment: Text.AlignHCenter
                  text: "A very long long long long long text"
              }
          }
          Rectangle {
              width: 200
              height: 100
              anchors.centerIn: parent
              color: "limegreen"
              Text {
                  anchors.fill: parent
                  wrapMode: Text.Wrap
                  horizontalAlignment: Text.AlignHCenter
                  text: "A very long long\nlong long long\ntext"
              }
          }
      }
      

       

      Outcomes

      • The (auto-wrapped) text in the red rectangle is left-aligned (Not Expected)
      • The (manually-wrapped) text in the green rectangle is horizontally centered (Expected)

      Attachments

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

        Activity

          People

            paeglis Gatis Paeglis
            skoh-qt Sze Howe Koh
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes