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

System locale (returned by QLocale::system()) always returns Qt::LeftToRight for QLocale::textDirection

    XMLWordPrintable

Details

    • a90869861cbc9927af2bbab5a94630e47b33fd5c 4c3ec0caa839260c2252115535847b9277be32d7 bf2b794a9af7b0ed9ca2dbf48e12fb221523c645 (qt/qtbase/5.15)

    Description

      Set a RTL locale in Windows. Get a system locale by QLocale::system(). Get textDirection value - it will be Qt::LeftToRight, no matter of actual direction.

      QLocale::textDirection implementation uses a switch on QLocale::Script. QLocale::system().script() returns QLocale::AnyScript.

      Checked on Windows only, but looks like it will be the same for other platforms.

      Workaround: create another QLocale object using language and country of system locale. It will set script to proper value and return correct text direction.

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              sergei.nevdakh Sergei Nevdakh
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes