[PyQt] action group triggered signals

Scott Frankel frankel at circlesfx.com
Wed Jan 26 19:24:28 GMT 2011


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: actionGroupTest.py
Type: text/x-python-script
Size: 1849 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110126/10f889e7/attachment.bin>
-------------- next part --------------



More information about the PyQt mailing list