[OT] plugins and QDockWidget

Andreas Pakulat apaku at gmx.de
Sat Mar 24 20:56:51 UTC 2007


On 25.03.07 01:43:48, kitts wrote:
> Let me take the example of designer being embedded. Designer uses several 
> toolviews (dockwidgets) for each view. Among them is a widget properties 
> toolview. At the time of the view creation this tool view did not exist. 
> Subsequently when one of the widgets is selected in its view, a new 
> toolview is created for properties.
> 
> This may not be the perfect example as it is very predictable but i was 
> referring to such a situation where the need for creation of a new toolview 
> for an existing view is raised by view/plugin or maybe another toolview 
> itself.

Well, for the designer example: I don't know yet how this will work out,
basically because I'm not sure the parts of designer are decoupled
enough to make this possible. 

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).

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.

Andreas

-- 
Your reasoning is excellent -- it's only your basic assumptions that are wrong.




More information about the KDevelop-devel mailing list