How to get a pointer for mainwindow?

Andreas Pakulat apaku at gmx.de
Mon Mar 12 09:03:34 UTC 2007


On 12.03.07 00:55:47, dukju ahn wrote:
> >From my plugin, I want to append popup menu in mainwindow
> ie.
> 
> connect( Core::mainWindow(),
>              SIGNAL(contextMenu(KMenu *, const Context *)),
>              this,
>              SLOT(contextMenu(KMenu *, const Context *)));
> 
> void KDevSubversionPart::contextMenu
>         (KMenu *menu, const KDevelop::Context *ctx)
> { menu->add.. }
> 
> This is from kdevcontext.h documentation. However, Core::mainWindow()
> does not actually exist. I cannot find any other way to retrieve
> mainwindow pointer.
> 
> Plugins can have access to ICore, and through ICore, IUiController
> can be accessed. But activeMainWindow() or defaultMainWindow()
> only exist in UiController, which the plugins does not have access.z

They do have access to ICore, see the IPlugin API.

> I looked up the KDevelop3 source code. At kdev3, ICore(KDevCore) emits
> contextMenu signal. Does the framework API is changed?

Yes of course it changed, because the KDevelop3 framework is not easily
usable for a platform approach like KDevelop4.

Andreas

-- 
You may worry about your hair-do today, but tomorrow much peanut butter will
be sold.




More information about the KDevelop-devel mailing list