[OT] plugins and QDockWidget

kitts kitts.mailinglists at gmail.com
Sat Mar 24 18:54:46 UTC 2007


On Saturday 24 Mar 2007 IST, Alexander Dymo wrote:
> On Saturday 24 March 2007 19:46, kitts wrote:
> > I was wondering how kdevelop's embedded designer maintained
> > dockwidgets? As i know only mainwindows can dock widgets. The only way
> > i see it possible is that designer maintains a mainwindow which is
> > embedded into the kdevelop's central tabwidget!?
>
> QtDesigner indeed has a mainwindow with docks. When I wrote KDevDesigner
> KPart, I just used that mainwindow as a part widget that gets embedded
> into a tab.

Thanks for the input.

> > On the otherhand if kdevelop used qt4 dockwidgets for its tools
> > interface then would it be possible that when a designer (a plugin?)
> > file tab is opened that its own dock widgets merge with the other
> > kdevelop dockwidgets and then automatically disappear on tab switch?
> >
> > I think for that to be possible, kdevelop's mainwindow should be the
> > owner of the dockwidget and designer should be informed that it has
> > lost focus. It then should hide all its own dockwidgets? Right?
>
> One possible way to do that is
> - have designer kpart which is embedded as normally
> - have a kdevelop plugin that reacts on designer part activation signal,
> asks designer part about its toolviews and adds/removes them to
> kdevelop's mainwindow as necessary

So that's basically a plugin to handle the designer part? designer should 
then not open any dockwidgets itself but should provide the widget to be 
embedded in them.

So generally speaking, i assume that every plugin instance maintains a 
pointer to the mainwindow passed to it in the constructor, holds the 
responsibility of providing its own mainwidget (if applicable) and receives 
activation signals to show/hide associated dockwidgets.

Its my first time building an app with plugins and was wondering what is 
popular design. Thanks you all for your help.
-- 
Cheers!
kitts




More information about the KDevelop-devel mailing list