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

loading qt_*.qm for RTL languages don't set layout direction to Qt::RightToLeft

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0
    • 5.3.0, 5.4.0
    • Widgets: Layout
    • None
    • Linux, Windows
    • qtbase.git: 49af548abb03743eabb8727ac685e1c290cb2118, qttranslations.git: dc511a947ab16429682e4887f95f94fc8bcb6fd2

    Description

      When an application loads with a right to left language (e.g. Persian, Arabic) it's layout should be switched to Qt::RightToLeft, too.
      There's a translatable string within QApplication class (i.e. tr("QT_LAYOUT_DIRECTION")) responsible for detecting correct layout direction for loaded translation language.

      This works on Qt4 but it doesn't work on Qt5.

      P.S.: The language file qt_*.qm is loaded successfully because when I add the following line to the application it works correctly:

      a.setLayoutDirection(QApplication::tr("QT_LAYOUT_DIRECTION") == QLatin1String("RTL") ? Qt::RightToLeft : Qt::LeftToRight);

      A sample file was attached.

      Attachments

        1. layout-direction-test-qt4-correct.png
          10 kB
          S. Razi Alavizadeh
        2. layout-direction-test-qt5.png
          9 kB
          S. Razi Alavizadeh
        3. main.cpp
          1 kB
          S. Razi Alavizadeh
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            smd Jan Arve
            srazi S. Razi Alavizadeh
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes