On Thursday 08 August 2013 10:26:49 Jan Kundrát wrote: > On Thursday, 8 August 2013 10:15:53 CEST, Pali Rohár wrote: > > KMail is written as KDE KPart application. > > I know nothing about KParts, so let me rephrase my suggestion > -- if there's something in KMail which is setting up the > menus etc. *and* if this is applicable to Trojita, I'd > suggest to go the same route. > > Of course, if KMail is using e.g. some XML file for specifying > the layout of its main window, chances are that we cannot > follow that. Even then, it might be possible to check how are > the menus matched -- perhaps there's some kind of identifier > in the XML file and that identifier is matched against the > objectName() of the predefined menu items, etc. > > The above could very well be absolutely irrelevant -- as I > said, I don't know KParts. > > Jan
In XML file are defined menubars and toolbars with all K/QActions. It matching objectName(). In your cpp code you need to push all KActions objects to some list (KActionCollection). My Kontact plugin will got pointers to QAction objects via findChild and push them to KActionCollection list. It also install needed XML file. -- Pali Rohár pali.ro...@gmail.com
signature.asc
Description: This is a digitally signed message part.