[PyQt] default action names
Baz Walter
bazwal at ftml.net
Thu Oct 22 22:55:19 BST 2009
Scott Frankel wrote:
> On Oct 22, 2009, at 10:57 AM, Baz Walter wrote:
>
>> Scott Frankel wrote:
>>> Does a QMainWindow, or an app based on, one contain a list of default action
>>> names?
>>> I'm trying to add an action called "Settings" to my app. The addAction()
>>> method silently fails unless I rename or misspell the action, like "Foo" or
>>> "Setttings."
>>> Actions named "Settings", "Preferences", "Configuration" all silently fail.
>>> Trying to find what names may already be claimed, my invocations of the
>>> actions() method always return an empty list.
>>
>> it would help if you posted a complete example that demonstrates the problem.
>> the above code snippet doesn't show the action being added to anything. are
>> you trying add actions to a menu in the menubar, or are you trying to create a
>> context menu?
>>
>>
>
> I'm using addAction to add the action to the app's main menu.
>
> See simple, running code sample attached. Note line 59. The action's first arg
> is misspelled "Setttings." Using the correct spelling, the action silently
> fails to be added to the menu.
sorry, but it works perfectly fine for me. that is, i changed the
spelling to "Settings...", and that's exactly how it appears in the menu.
what happens if you replace line 70 with:
print repr(self.fileMenu.addAction('Settings'))
More information about the PyQt
mailing list