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

Wrong direction of QToolBar extension button icon when RTL interface used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.0
    • 5.10.0
    • None
    • Windows 8.1 x64

    Description

      Try to run this code:

      #include <QApplication>
      #include <QWidget>
      #include <QVBoxLayout>
      #include <QCheckBox>
      #include <QToolBar>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          // Setup window layout
      
          QWidget widget;
          widget.setFixedWidth(50);
          QVBoxLayout layout;
          QCheckBox chkRtl("RTL interface");
          QToolBar toolBar;
          widget.setLayout(&layout);
          layout.addWidget(&chkRtl);
          layout.addWidget(&toolBar);
          widget.show();
      
          // Setup rtl checkbox
      
          QObject::connect(&chkRtl, &QCheckBox::stateChanged, [=](int state) {
              Qt::LayoutDirection dir = Qt::LeftToRight;
              if (state == Qt::Checked)
                  dir = Qt::RightToLeft;
              QApplication::setLayoutDirection(dir);
          });
      
          // Setup toolbar
      
          toolBar.addAction("New");
          toolBar.addAction("Open");
          toolBar.addAction("Close");
          toolBar.addAction("Quit");
      
      
          return a.exec();
      }
      

      You can switch between LTR and RTL interface mode using checkbox. Notice the extension (">>") button always pointing to the right side. Shouldn't it point to the left side in RTL interface mode?

       

       

       

      Attachments

        1. Ext btn bug.png
          Ext btn bug.png
          6 kB
        2. main.cpp
          0.9 kB
        3. qtbug66344.zip
          1 kB
        For Gerrit Dashboard: QTBUG-66344
        # Subject Branch Project Status CR V

        Activity

          People

            richard Richard Moe Gustavsen
            yuri_q Yuri M
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes