0
votes

There is QTabWidget with some tabs and i want to make to user can move widgets in each tab and attach them to any side of tab.

Among the standard widgets this functionality have QToolBar and QDockWidget, but they attach only to QMainWindow.

Is there any widgets that can attach to my widget which inherits QWidget? Or any solutions to make changeable interface?

Thanks.

P.S. My english is terrible, I know.

1

1 Answers

0
votes

By default I don't think that's possible.

You can however implement that functionality yourself by for example checking boundaries and when a certain threshold is met you set its x or y to the parent x and or y. Adding an animation would make it seem smoother also.

Another way would be to use a QMainWindow instead, so you can use QDockWidget.

There's no rule against having multiple QMainWindow and they inherit from QWidget anyhow which makes them work with for example QTabWidget::addTab(QWidget *page, const QString &label).

How this affects performance would be worth a test.