Dynamic RadioButton creation with Python + Qt

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wagner Garcia Campagner

    #1

    Dynamic RadioButton creation with Python + Qt

    Hello,

    I'm trying to create dynamic RadioButton as follows:

    for i in out.keys():
    msg = "radioButto n_" + str(i)
    msg2 = 20 * x
    msg = QRadioButton(se lf.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.


Working...