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

    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

            Unassigned Unassigned
            skoh-qt Sze Howe Koh
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes