[PyQt] Help menu and own icon

Christoph Burgmer chrislb at gmx.de
Wed Apr 16 21:18:24 BST 2008


My app kept showing the "icon-not-found" icon, so I started looking around how 
other apps handle this. pykdedocs has this following magic lines:

>         helpMenu = KHelpMenu (self, aboutData, False)
>         self.menuBar ().addMenu (helpMenu.menu ())
>         self.aboutAction    = helpMenu.action (KHelpMenu.menuAboutApp)
>         self.aboutAction.setIcon (KIcon ("help-about"))
>         self.aboutKDEAction = helpMenu.action (KHelpMenu.menuAboutKDE)
>         actions.addAction ("about", self.aboutAction)
>         actions.addAction ("aboutKDE", self.aboutKDEAction)

If I do the same it adds a second help menu, and even gives me the "choose 
language" entry, but then "What is..." is missing.
Well why all the magic when all I want is to set the app icon for the menu and 
let the app image show up in the following dialog? The latter [1] funnily 
doesn't work unless setting the menu with the above method.

1. There is no such thing like self.menuBar().getMenu() (or in Qt 
terms .menu()), so I ask myself if the above is the only way to solve my 
problem?
2. How to avoid 2 menus showing up then?
3. The app image not showing up in the "About..." dialog without the magic 
menu setting - is that a bug or a feature?
4. Why does KHelpMenu offer different entries compared to the XMLGuiClient 
class? (This maybe is to much for the list, but maybe someone knows.)

Thanks for any hints.

Chris

[1] http://www.riverbankcomputing.com/static/Docs/PyKDE4/faq.html#faq-logo


More information about the PyQt mailing list