PyQT 4.6.2 question about radiobuttons

N

News123

Hi,

As you wll notice: I don't have a lot of GUI and only very litte
PyQT-experience.


I have a UI created with qt designer.

The UI contains a few named radio buttons in a button group.
( for example radioButton_one to radioButton_four )


I am unable locate a signal, that is fired whenever one of the
radiobuttons in a group have been changed.


however what I am able to is to connect the same slot to all
of the clicked events of a buttongroup


buttons = [
win.radioButton_one,
win.radioButton_two,
win.radioButton_three,
win.radioButton_four
]

for button in buttons:
button.cloicked.connect( self._mymethod )


My questions are:

1.) Is there a signal in the buttongroup, that would fire?

2.) if not. What is the easiest way to get a list of all radiobuttons
belonging to a buttongroup


Thanks in advance for your any suggestions good pointers
 
P

Phil Thompson

Hi,

As you wll notice: I don't have a lot of GUI and only very litte
PyQT-experience.


I have a UI created with qt designer.

The UI contains a few named radio buttons in a button group.
( for example radioButton_one to radioButton_four )


I am unable locate a signal, that is fired whenever one of the
radiobuttons in a group have been changed.


however what I am able to is to connect the same slot to all
of the clicked events of a buttongroup


buttons = [
win.radioButton_one,
win.radioButton_two,
win.radioButton_three,
win.radioButton_four
]

for button in buttons:
button.cloicked.connect( self._mymethod )


My questions are:

1.) Is there a signal in the buttongroup, that would fire?
QButtonGroup.buttonClicked()

2.) if not. What is the easiest way to get a list of all radiobuttons
belonging to a buttongroup
QButtonGroup.buttons()

Thanks in advance for your any suggestions good pointers

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qbuttongroup.html

Phil
 
W

woooee

QT uses "toggled". I do not use QT much but it would be something
like
self.radioButton_one.setCheckable(True)
QtCore.QObject.connect(self.radioButton_one, QtCore.SIGNAL("toggled
()"),self.button_one_function)

If this doesn't work, you can probably find more with a Google for
"toggled".
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top