Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8.0
-
None
-
-
57361de3a (dev), d8ed81002 (6.8)
Description
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(¢ral); }; 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(); }