Dynamic RadioButton creation with Python + Qt

  • Thread starter Wagner Garcia Campagner
  • Start date
W

Wagner Garcia Campagner

Hello,

I'm trying to create dynamic RadioButton as follows:

for i in out.keys():
msg = "radioButton_" + str(i)
msg2 = 20 * x
msg = QRadioButton(self.buttonGroup_interfaces, msg)
msg.setGeometry(QRect(30,msg2,121,23))
msg.setTect(i)
x += 1

The problem is that Python is creating all RadioButton as "msg" and not the
value of "msg" so i can't access the RadioButton after the creation.

Is there a way i can create the RadioButton with diferent names??

Thanks in advance,
Wagner.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top