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

setLayoutDirection breaks text on QPushButton

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.4.0, 5.8.0
    • None
    • Windows 7, MSVC 2015, 64 bit

    Description

      Since Qt 4.7,

      qApp->setLayoutDirection(Qt::RightToLeft);

      should have no effect on any rendered text. E.g. a QLabel with the text -20 should and does show that string, regardless of the layout direction. But with QPushButton, the following causes the text to be displayed as 20- :

      ui->pushButton_3->setText("-20");
      qApp->setLayoutDirection(Qt::RightToLeft);

      The bug was reported to affect 5.4.0 by a user on the forum, see https://forum.qt.io/topic/77716. I can reproduce it with 5.8.0.

      Attachments

        1. image-2017-11-06-15-05-47-039.png
          image-2017-11-06-15-05-47-039.png
          52 kB
        2. qtbug59807.zip
          5 kB
        3. screenshot-1.png
          screenshot-1.png
          900 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            Wieland Patrick Wieland
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes