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

Having the width of Text bound to implicitWidth can result in incorrect layout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.3.1
    • None

    Description

      The example below will fail to right align the text.

      import QtQuick 2.0
      
      Rectangle {
              property real margin: 24
              width: 500
              height: 600
              Text {
                      id: foo
                      font.pixelSize: 40
                      text: 'The quick brown fox jumps over the lazy dog'
                      width: Math.min(implicitWidth, parent.width - 2*margin)
                      horizontalAlignment: Text.AlignRight
                      anchors {
                          right: parent.right
                          rightMargin: margin
                      }
              }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-40161
        # Subject Branch Project Status CR V

        Activity

          People

            martinj Martin Jones
            martinj Martin Jones
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes