QRadioButton Bug

Discuss anything related to product development
Post Reply
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

QRadioButton Bug

Post 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.
barbara
Posts: 452
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QRadioButton Bug

Post by barbara »

Thanks for your report. We have been able to repeat this problem and we will work on a fix.
barbara
Posts: 452
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QRadioButton Bug

Post by barbara »

We have found a solution to this issue and it is going through our internal CI testing.
barbara
Posts: 452
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QRadioButton Bug

Post by barbara »

We have pushed a new commit to github with a fix for this issue.
Post Reply