[PyQt] Accessing the menu objects in an application

Tony Cappellini cappy2112 at gmail.com
Sun Mar 25 06:15:06 BST 2007

I've added 4 Actions to the menu bar using designer.and connected most
of those signals
to the appropriate slots.

However, I have enabled the Checkable options on a few of these
actions, and want these checkable actions to call the same method,
whenever any of these actions is triggered.

I know how to connect the triggered signals to the slot for the method
which will be called, but I need to know which of these actions called
the method.

Only one action can be checked at a time, but the Checked attribute of
actions doesn't have the exclusive nature that radio buttons do when
those buttons are in a group box.

So I need to uncheck the previous action that was checked myself.

In order to do that, I need to know which action called the method.
The triggered signal passes true or false, but not which action it belongs to.

However, I don't know how to setup the signal/slot mechanism to pass
another argument so the method knows which action called it.

Would someone post a Python example of how to handle this?


More information about the PyQt mailing list