Unable to click on QRadioButton after linking it with QtCore.QEventLoop()

2024/11/15 6:51:38

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?

Answer

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

https://en.xdnf.cn/q/119447.html

Related Q&A

Distance Matrix Haversine

I am working on a data frame that looks like this :lat lon id_zone 0 40.0795 4.338600 1 45.9990 4.829600 2 45.2729 2.882000 3 45.7336 4.850478 4 45.6981 5.…

python google geolocation api using wifi mac

Im trying to use Googles API for geolocation giving wifi data to determine location. This is their intro. And this is my code@author: Keith """import requestspayload = {"c…

Python requests and variable payload

Reticulated members,I am attempting to use a GET method that is supported against the endpoint. However, I am using python and wanting to pass the user raw_input that is assigned to a variable:uid = ra…

How should I read and write a configuration file for TkInter?

Ive gathered numbers in a configuration file, and I would like to apply them to buttons. Clicking the button should allow the number to be changed and then re-written to the config file. My current cod…

How to convert this nested dictionary into one single dictionary in Python 3? [duplicate]

This question already has answers here:Convert nested dictionary into a dictionary(2 answers)Flatten nested dictionaries, compressing keys(32 answers)Closed 4 years ago.I have a dictionary like this:a …

How to click unopened tabs where the numbers change

How do I click all the unopened tabs pages where the value changes when you click tabs? (see image below)Take the following script, based off of this question with the following approach:clickMe = wai…

Xlwings / open password protected worksheet in xlsx?

I get an answer how to open a password protected xlsx with xlwings: Xlwings / open password protected xlsx? wb = xlwings.Book("file.xlsx", password="Passw0rd!")But can i also open …

Wrapping an opencv implementaion of an error level analysis algorithm using cython

i have implemented an error level analysis algorithm using c++(opencv version 2.4) and i want to build a python wrapper for it using cython. I have read some part of the documentation of cython for c++…

Setting yticks Location Matplotlib

Im trying to create a plot which has y axis exactly same with this : And Im in this situation and everything is ok until this point:When i try this lines:ax.set_yticks(range(20,67,10)) ax.set_yticklabe…

How to merge list to become string without adding any character in python?

I found that I can join them with -.join(name) but I dont want to add any character. Lets say I have [stanje1, |, st6, , stanje2, |, #] and I want to be like thisstanje1|st6,stanje2|#