Page 1 of 1

QRadioButton Bug

Posted: Thu Mar 31 2022 6:32 pm
by seasoned_geek
If you have code like this in your dialog constructor

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 );
    }
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.

Re: QRadioButton Bug

Posted: Sat Apr 02 2022 5:12 am
by barbara
Thanks for your report. We have been able to repeat this problem and we will work on a fix.

Re: QRadioButton Bug

Posted: Mon Apr 04 2022 9:08 pm
by barbara
We have found a solution to this issue and it is going through our internal CI testing.

Re: QRadioButton Bug

Posted: Wed Apr 13 2022 1:08 am
by barbara
We have pushed a new commit to github with a fix for this issue.