PDA

View Full Version : QTabWidget drag and drop



ComaWhite
2nd May 2009, 04:35
I was wondering how much of this would be possible. I have an network application that needs drag and drop with tabs. Each tab holds a reference to a QSslSocket for communicating. I have a tab widget inside of another tab widget.
__________________
| TabWidget1............|
| _______________ .|
| | TabWidget2....... |.|
| --------------------..|
|_________________|

I want to be able to pull a tab from TabWidget2 and drop it inside of TabWidget1 above or below TabWidget2. But not attach it to TabWidget1's tabs. But create another QTabWidget inside of TabWidget1 so there would be TabWidget3 above TabWidget2 or below.

I need to also be able to keep the existing Socket and all the slots connecting to it.

wysota
4th May 2009, 13:03
Each tab in a tab widget is a widget. If you implement a drop mechanism on your tab widget that creates a new child tab widget and adds an arbitrary tab to it, you can then move an existing tab from one tabwidget to another.