[PyQt] action group triggered signals

Scott Frankel frankel at circlesfx.com
Wed Jan 26 20:35:57 GMT 2011


Phil,

On Jan 26, 2011, at 11:48 AM, Phil Thompson wrote:

> On Wed, 26 Jan 2011 11:24:28 -0800, Scott Frankel <frankel at circlesfx.com 
> >
> wrote:
>> Hi all,
>>
>> What's the best way to connect an action group triggered signal?  The
>> following isn't working:
>>
>> 	self.connect(self.theActGroup, QtCore.SIGNAL("triggered(action)"),
>> self.foo)
>>
>>
>>
>> I'm adding a QToolButton with mutually exclusive actions to a
>> QToolBar.  I must be missing something obvious, since the method I
>> connect to the triggered signal is not executing.  eg:
>>
>> 	self.theButton          = QtGui.QToolButton()
>> 	self.theButton.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
>> 	self.theActGroup  = QtGui.QActionGroup(self.theButton)
>> 	self.theActGroup.setExclusive(True)
>> 	# actions added here...
>>
>> 	self.connect(self.theActGroup, QtCore.SIGNAL("triggered(action)"),
>> self.foo)
>> 	# self.foo() not executed
>>
>> See attached file for simple, working example.
>>
>> Thanks!
>> Scott
>
> The signal signature is "triggered(QAction *)".
>
> If you used new-style connections you wouldn't have to worry about  
> this.

Understood.  Thanks for the info,
Scott



>
> Phil
>



More information about the PyQt mailing list