PDA

View Full Version : how to tabify a qdockwidget to another floating qdockwidget



eric_vi
7th December 2010, 16:21
Hello,

i can create a tab of a qdockwidget to a second one, when the second is docked. But i would like to tabify my first qdockwiget when the second is floating, is it possible? i went through the documentation i do not see how.

Thanks for all your help

stefanadelbert
7th December 2010, 22:46
As far as I know this is not possible with the existing QDockWidget functionality. I think you'd explicitly need to detect when one floating QDockWidget is being dragged onto another QDockWidget and then you'd need to add both of contained widgets into a QTabWidget which you could then place into another floating QDockWidget.

You'd then need a way to split them back out into their own separate QDockWidgets again.

You'd need to think about the case where the QDockWidget containing a QTabWidget is docked with the QMainWindow again. If you have the functionality to split the tabs into separate QDockWidgets (as above) then you could do this and then dock the resulting QDockWidgets on on top of the other.

Visual Studio 2008 has similar functionality and I've been keen on implementing something like that myself. Post back if you come up with another solution or manage to implement this.