qtstarter121
17th April 2018, 18:59
So I have a bunch of QPushButtons in QGridLayout and they all have autoExclusive = true. These buttons are loaded from a .ui file.
I added two new QPushButtons to the layout programmatically, and set the same property autoExclusive to true for them.
In my code when each button is clicked I have the following
if (!button->isChecked())
{
button->setChecked(true);
}
Now when I click on either of these two new QPushButtons, they don't get unchecked when I click any other button, but the rest of them do, so I'm not sure why the autoexclusive property doesn't work for these buttons that were added programmatically.
I added two new QPushButtons to the layout programmatically, and set the same property autoExclusive to true for them.
In my code when each button is clicked I have the following
if (!button->isChecked())
{
button->setChecked(true);
}
Now when I click on either of these two new QPushButtons, they don't get unchecked when I click any other button, but the rest of them do, so I'm not sure why the autoexclusive property doesn't work for these buttons that were added programmatically.