On a selection check false i try to prevent the selection of that radiobutton. But it does get selected anyway, even with singleshot timer:
class MyQWidget(QWidget):
def __init__(self):
QWidget.__init__(self)
...
self.ui.buttonGroup.buttonPressed.connect(self.is_init)
def is_init(self, button):
if True: #some check here to prevent selection of it
print('no select')
QTimer.singleShot(0, lambda: button.setChecked(False))
EDIT:
Assume a button group, i try to intercept the press call (not clicked) to not select that radio button if a custom test is false (if True: #some check
), but i cannot prevent the button from being selected also i set it to False
, how do abort the selection of the clicked/pressed radio button if a condition is not met?