Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.3.1
-
None
Description
The following example demonstrates strange behavior with autoExclusivity.
#include <QApplication>
#include <QWidget>
#include <QVBoxLayout>
#include <QFrame>
#include <QRadioButton>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QWidget w;
QVBoxLayout *l = new QVBoxLayout(&w);
QFrame *frame = new QFrame(&w);
frame->setFrameStyle(QFrame::Raised);
l->addWidget(frame);
QVBoxLayout *frameLayout = new QVBoxLayout(frame);
frameLayout->addWidget(new QRadioButton("&1", frame));
frameLayout->addWidget(new QRadioButton("&2", frame));
l->addWidget(new QRadioButton("&3", &w));
l->addWidget(new QRadioButton("&4", &w));
w.show();
return a.exec();
}
To reproduce:
first issue:
run app
click 3
click 4 (notice that 3 gets unchecked)
click 1 (notice that 4 remains checked. This is expected)
click 2 (notice that 4 remains checked and 1 gets unchecked. This is expected)
click 3 (notice that 4 remains checked. This is not expected)
second issue:
comment out button 2
run app
click 1
click 2 (notice that 1 gets unchecked. This is a little unexpected)
click 3 (notice that 2 gets unchecked. This is expected)
click 2 (notice that 3 gets unchecked. This is expected)
click 1 (notice 2 remains checked. This is unexpected)
Attachments
Issue Links
- resulted in
-
QTBUG-182 QRadioButton autoExclusive is broken when parent widget of the buttons has a child widget which also contain radio buttons
-
- Closed
-