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

Right-to-left text with AlignLeft alignment not to the right

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.9
    • Widgets: Layout
    • None
    • Windows

    Description

      I created a Qt Quick application and i noticed that when i'm using Right-to-left text and Text.AlignLeft, the text is aligned to left but shouldn't it be aligned to right? And when i do the opposite with Text.AlignRight, it will be aligned to right instead of left.

      import QtQuick 2.15
      import QtQuick.Window 2.15
      
      Window {
          width: 800
          height: 200
          visible: true
          title: qsTr("test")
      
          Text {
              id: name
              x: 0
              y: 0
              width: 800
              height: 100
              color: "black"
              text: "لْأَبْجَدِيَّة الْعَرَبِيَّة!#¤%"
              font.family: "Noto Sans Arabic"
              font.pixelSize: 20
              horizontalAlignment: Text.AlignLeft
          }
      }
      

      Example with Text.AlignLeft:

      Example with Text.AlignRight:

      Font can be downloaded from https://fonts.google.com/noto/specimen/Noto+Sans+Arabic

      Attachments

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            aarotone Aapo Rotonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: