how to preventoverlapping between two qdockwidgets in same area?

689 views Asked by At

I have two qDockWidgets have the same allowed area ,qt by default allows overlapping between two dock widgets so the two dock widgets will be a one tab widget . I want to stop this behavior

2

There are 2 answers

0
MaramWadi On BEST ANSWER

to stop the tabbing between two dock widget add this line of code in your application

setDockOptions(QMainWindow::AnimatedDocks);

the default value of DockOptions in qt is AnimatedDocks | AllowTabbedDocks

1
Creative Coder On

Just try to setFocusPolicy to Qt::ClickFocus, which mean the QWidget will accept focus only by mouse click and not by keyboard tab.

more info at this link http://qt-project.org/doc/qt-4.8/qwidget.html#focusPolicy-prop