[OT] plugins and QDockWidget

Andreas Pakulat apaku at gmx.de
Sat Mar 24 23:37:03 UTC 2007


On 25.03.07 03:32:57, kitts wrote:
> On Sunday 25 Mar 2007 IST, Andreas Pakulat wrote:
> > On 25.03.07 01:43:48, kitts wrote:
> > However, in general only a plugin can tell the shell to add a new
> > toolview, by providing a factory. So if any toolview wants to
> > show/activate another toolview it needs to be connected to the plugin
> > for that other toolview (or hopefully its extension interface).
> 
> Ah! this is probably the most important part for me. How exactly does the 
> plugin tell the shell to add a new or delete an old toolview?

For adding we have: addToolView( "name", factory);
there's currently no API that can show/hide or delete a toolview
available to plugins. The uicontroller deletes the factory when its
deleted itself.

> > This is something that works already, lets take the QMake Manager in
> > KDevelop4 as example, it already provides a mechanism to run qmake and
> > make on a given project. The execution of the commands is encapsulated
> > in another plugin, the outputview, which also displays the output of the
> > commands. Now this outputview provides a toolview. Currently it shows
> > the toolview as soon as the outputview plugin is loaded, but this could
> > be deferred until somebody actually runs a command through it (the
> > outputview plugin has an API for running an arbitrary command). Then it
> > would askt he uicontroller to add a toolview for its outputwidget.
> 
> Out of curiosity, in kdev4 with multiple mainwindows and a single instance 
> for each plugin, how is the information of "which mainwindow" conveyed from 
> one plugin to another?

Until now no plugin knows about mainwindow's. A plugin that wants to
have a toolview provides a factory to create the widget that is to be
shown in the toolview and then tells the uicontroller to add a toolview
from that factory (with the given name). The uicontroller then decides
in which area to display the toolview (I think, Alex knows this better
as he designed the ui-library called sublime), however none of this is
implemented at the moment - AFAIK. The plugin doesn't need to know about
the mainwindow, there's no reason for this.

> > --
> > Your reasoning is excellent -- it's only your basic assumptions that are
> > wrong.
> 
> Was that automatic or did you add it in? ;-)

Thats fortune inserting a nice line at the end of my mails.

Andreas

-- 
Good day to let down old friends who need help.




More information about the KDevelop-devel mailing list