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

Regression: QComboBox doesn't display items correctly when layoutDirection is set to Qt::RightToLeft

    XMLWordPrintable

Details

    • macOS

    Description

      When setting Qt::RightToLeft on a QComboBox, the items are displayed left to right when dropped down.

      #include <QApplication>
      
      #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
      #include <QtWidgets>
      #else
      #include <QtGui>
      #endif
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QMainWindow mainWindow;
          QComboBox comboBox(&mainWindow);
          comboBox.setLayoutDirection(Qt::RightToLeft);
          comboBox.addItem("Test1");
          comboBox.addItem("Test2");
          comboBox.addItem("Test3");
          comboBox.addItem("Test4");
          mainWindow.show();
          return app.exec();
      }
      

      This worked in Qt 4.8 as shown in the attached screenshots. Works fine on Windows 7.

      Attachments

        1. fusion.stack
          5 kB
          Friedemann Kleint
        2. qtbug31430_fusion_diag.diff
          3 kB
          Friedemann Kleint
        3. qtbug31430.zip
          1 kB
          Friedemann Kleint
        4. RTL_combobox_mac_fix.diff
          2 kB
          Qt Support
        5. rtl-4.8.png
          14 kB
          Mitch Curtis
        6. rtl-4.8-drop.png
          2 kB
          Mitch Curtis
        7. rtl-5.1-beta.png
          9 kB
          Mitch Curtis
        8. rtl-5.1-beta-drop.png
          2 kB
          Mitch Curtis

        Issue Links

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

          Activity

            People

              tpochep Timur Pocheptsov
              mitch_curtis Mitch Curtis
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes