QRadioButton Bug
Posted: Thu Mar 31 2022 6:32 pm
If you have code like this in your dialog constructor
Your application will die with some long string of stuff that ends with find_children.
Moving the if statement lower in the constructor after all objects have been created, added to layouts and groups and the main dialog layout assigned allows the code to work.
CheckBox and the other widgets (at least the other ones I've used) don't have this issue.
It appears setChecked( bool) doesn't properly handle a parent of nullptr.
I built from tip of tip just a few days ago.
Code: Select all
m_numLockRBTN = new QRadioButton( tr( "NumLock" ) );
m_scrollLockRBTN = new QRadioButton( tr( "ScrollLock" ) );
if ( Overlord::getInstance()->numlockIsGold() )
{
m_numLockRBTN->setChecked( true );
}
else
{
m_scrollLockRBTN->setChecked( true );
}
Moving the if statement lower in the constructor after all objects have been created, added to layouts and groups and the main dialog layout assigned allows the code to work.
CheckBox and the other widgets (at least the other ones I've used) don't have this issue.
It appears setChecked( bool) doesn't properly handle a parent of nullptr.
I built from tip of tip just a few days ago.