c++qtqdockwidget

QDockWidget vertical preference


I am using QDockWidget in my application. The widgets by default align like this: enter image description here

However, I want my application to have a preference for the vertical docks like this: enter image description here

Is there a way to achieve this? I am using Qt 5.10.0. Thanks


Solution

  • You have to assign corners to respective dock areas in main window, using

    void QMainWindow::setCorner(Qt::Corner corner, Qt::DockWidgetArea area)
    

    e.g.

    setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );