title: QMainWindow: size management of central widget and dock widgets
body: <p>I want mainwindow to keep approximate ratio of dock widget sizes and central widget size, when the window's size is changed. I've written simplest mainwindow with central widget and 6 dock widgets:</p>
  
  <pre><code>#include &lt;QPlainTextEdit&gt;
  #include &lt;QDockWidget&gt;
  
  #include "mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent)
  {
      this-&gt;setGeometry(20, 20, 600, 600);
  
      this-&gt;setCentralWidget(
            new QPlainTextEdit("central", this)
            );
  
      QDockWidget *p_dw;
  
      for (int i = 0; i &lt; 6; ++i){
         p_dw = new QDockWidget("dock " + QString::number(i));
  
         p_dw-&gt;setWidget(
               new QPlainTextEdit("dock " + QString::number(i), this)
               );
  
         Qt::DockWidgetArea area;
         switch (i){
            case 0:
            case 1:
               area = Qt::TopDockWidgetArea;
               break;
            case 2:
               area = Qt::RightDockWidgetArea;
               break;
            case 3:
            case 4:
               area = Qt::BottomDockWidgetArea;
               break;
            default:
               area = Qt::LeftDockWidgetArea;
               break;
         }
  
         addDockWidget(area, p_dw);
      }
  }
  
  MainWindow::~MainWindow()
  {
  }
  </code></pre>
  
  <p>When started, it looks as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/XIBK0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XIBK0.png" alt="enter image description here"></a></p>
  
  <p>I can shrink it:</p>
  
  <p><a href="https://i.stack.imgur.com/hOVSE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hOVSE.png" alt="enter image description here"></a></p>
  
  <p>And expand back, and after expanded, it looks as at the first screenshot. It is fine.</p>
  
  <p>The problem is that if user "touches" central widget bounds (I mean, changes the central widget size manually, ever for a little bit), then main window changes its policy dramatically: after user touches central widget, then shrinks window, and then expands it back, all dockwidgets have their minimum sizes:</p>
  
  <p><a href="https://i.stack.imgur.com/00m5N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/00m5N.png" alt="enter image description here"></a></p>
  
  <p>The question is, how to prevent this behavior? Or, more generally, how can I influence on the size policy of <code>QMainWindow</code>? I can't find any documentation about the behaviour I've explained above.</p>