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

Text item alignment is incorrect when LayoutMirroring is enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0
    • 5.0.2, 5.1.1, 5.2.0
    • None
    • reproduced on Linux (Ubuntu 13.04) and MacOS with Qt 5.0.2, 5.1.1
      didn't test it on Windows
    • qtdeclarative/stable: e8aaaaf3b9e4cf0fdf46ba1bce589d00259e0bad and afb5bf71c942d411d6102ce637bc7499d8ae467c

    Description

      The text inside QML Text item is not aligned correctly when LayoutMirroring is enabled and width of the item is changed dynamically.

      Here is small example showing the problem, text should be always aligned to right (Text.AlignLeft + LayoutMirroring), but is stays in the middle.
      It works fine when LayoutMirroring is disabled.

      import QtQuick 2.0
      
      Rectangle {
          id: root
          width: 200
          height: 50
      
          Text {
              anchors.fill: parent
      
              text: "RTL test"
      
              horizontalAlignment: Text.AlignLeft
              LayoutMirroring.enabled: true
      
              Rectangle {
                  anchors.fill: parent
                  color: "transparent"
                  border.color: "red"
              }
          }
      
          Component.onCompleted: {
              root.width = 400;
          }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            akozhanov Andrey Kozhanov
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes