1
votes

I'm looking for an existing solution in Qt5 which would allow me to construct a QWidget with horizontal layout with some child widget which would be movable within parent widget area.

As an example of such behaviour you may try to play with tabs in firefox - user can drag a tab and move it right and left and other tabs are drawing aside to make a place for dragged one.

Also I'd like to be able to drag and drop child widgets from one parent widget to another, like in case of firefox: one tab can be dragged to another window. However in my case drag and dropping would occur in one application.

Is there such a solution or I've to do it myself?

1

1 Answers

2
votes

I am using Qt4 but I am sure that the following should work for Qt5 too:

  • For moving tabs within tabwidget there is a API "setMovable (bool movable)" available in QTabWidget class.

  • To your other requirement you may need to do a little bit of coding. You should look into documentation of QDrag class and examples of drag-drop in qt installation (examples/draganddrop) folder.

Santosh