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

Text Alignment doesn't work as it's claimed in the documentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • Qt for MCUs 2.3.1
    • Documentation, Font Engine, QML
    • None
    • Windows

    Description

      link : https://doc.qt.io/QtForMCUs-2.3/qtul-fonts.html#text-alignment

      I'm trying out the code snippet shown in the link above.

      // automatically aligned to the left
      Text {
          text: "Phone"
          width: 200
      }
      
      // automatically aligned to the right
      Text {
          text: "خامل"
          width: 200
      }
      
      // aligned to the left
      Text {
          text: "خامل"
          horizontalAlignment: Text.AlignLeft
          width: 200
      } 

      According to the code, the second Arabic sentence should be aligned to right, but it's not so on my end with this code.

      import QtQuick 2.0Rectangle {
          id: root
          color: "white"
          width: 320
          height: 480
          z:10
      //    Column{
              // automatically aligned to the left
              Text {
                  id: t1
                  text: "Phone"
                  width: root.width
              }        // automatically aligned to the right
              Text {
                  id: t2
                  text: "خامل"
                  width: root.width
                  anchors.top: t1.bottom
              }        // aligned to the left
              Text {
                  id: t3
                  text: "خامل"
                  horizontalAlignment: Text.AlignLeft
                  width: root.width
                  anchors.top: t2.bottom
              }
      //    }
      }
       

      Here is the outcome of the code snippet above. As you can see, the second Arabic text is aligned to left, not right. Given the fact that the width of the second Text component is the same as the root(320), the Arabic text should've been touching the right edge of the window.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes