Unable to click on QRadioButton after linking it w

2019-09-19 16:39发布

Few days back i had situation where i had to check/uncheck QRadioButton in for loop. Here is the link Waiting in for loop until QRadioButton get checked everytime? After implementing QEventLoop on this, it worked fine until today. Now i have seen my QRadioButton(pass) button allow me to click on it but not the second QRadioButton(fail).

Fail QRadioButton neither gets hang nor disable but its just i am not able to click on it.

My QEventLoop code is :

#QLoopEvent 
self.loop = QtCore.QEventLoop()
self.ui.fail_radio.clicked.connect(self.loop.quit)
self.ui.pass_radio.clicked.connect(self.loop.quit)

Code in the for loop is :

self.ui.question_lbl.setText(self.saveQuestionslist[i])
self.loop.exec_();

if self.ui.fail_radio.isChecked():
    ***Some Code**
    self.radioExclusive()
elif self.ui.pass_radio.isChecked():
     ***Some Code**
    self.radioExclusive()

And this radioExclusive function does this :-

def radioExclusive(self):
        self.ui.pass_radio.setAutoExclusive(False);
        self.ui.fail_radio.setAutoExclusive(False);
        self.ui.pass_radio.setChecked(False)
        self.ui.fail_radio.setChecked(False)
        self.ui.pass_radio.setAutoExclusive(True);
        self.ui.fail_radio.setAutoExclusive(True);

I am not sure at what point this problem is happening?

1条回答
疯言疯语
2楼-- · 2019-09-19 17:05

Okay, the issue is not with QEventloop but while developing UI of Radio Pass, Extra Area of pass was shadowing Fail Radio.

enter image description here

查看更多
登录 后发表回答