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

windows11 style: radio buttons painted incorrectly inside scroll area

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.8.1, 6.9.0 FF
    • 6.8.0
    • Widgets: Styles
    • None
    • Windows
    • 57361de3a (dev), d8ed81002 (6.8)

      Radio buttons inside a QScrollArea aren't painted correctly. When checked, the filled circle in the middle is missing. When unchecked, the background is painted blue instead of the normal background color. This screenshot demonstrates the issue; A and B are outside of the scroll area and look as expected, whereas C and D are inside the scroll area.

      Sample project:

      QT += widgets
      SOURCES += main.cpp
      QMAKE_PROJECT_DEPTH = 0

      main.cpp:

      #include <QtWidgets>
      
      class MainWindow : public QMainWindow {
      public:
          MainWindow(QWidget *parent = nullptr) : QMainWindow{parent} {
              a.setText("A");
              b.setText("B");
              c.setText("C");
              d.setText("D");
              a.setChecked(true);
              c.setChecked(true);
              mainLayout.addWidget(&a);
              mainLayout.addWidget(&b);
              scrollLayout.addWidget(&c);
              scrollLayout.addWidget(&d);
              scrollWidget.setLayout(&scrollLayout);
              scrollArea.setWidget(&scrollWidget);
              mainLayout.addWidget(&scrollArea);
              central.setLayout(&mainLayout);
              setCentralWidget(&central);
          };
      private:
          QRadioButton a;
          QRadioButton b;
          QRadioButton c;
          QRadioButton d;
          QWidget central;
          QVBoxLayout mainLayout;
          QScrollArea scrollArea;
          QWidget scrollWidget;
          QVBoxLayout scrollLayout;
      };
      
      int main(int argc, char *argv[]) {
          QApplication a(argc, argv);
          MainWindow w;
          w.setWindowTitle("Test");
          w.show();
          return a.exec();
      }

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

            wladimir.leuschner Wladimir Leuschner
            jdpurcell J.D. Purcell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes