title: QDockWidgets merging incorrectly
body: <p>I have a <code>QDockWidget</code> class and a <code>QMainWindow</code>:</p>
  
  <pre><code>// docker.hpp
  class Docker : public QDockWidget
  {
      Q_OBJECT
  public:
      Docker(QString title, QWidget* parent = 0);
  }
  
  // docker.cpp
  Docker::Docker(QString title, QWidget* parent): QDockWidget(title, parent)
  {
      QWidget* widget = new QWidget(this);
      widget.setMinimumSize(200, 200);
      setWidget(widget);
      widget-&gt;setStyleSheet("border:5px solid gray;");
  
      setAllowedAreas(Qt::AllDockWidgetAreas);
  }
  
  // mainwindow.hpp
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  public:
      MainWindow(QWidget* parent);
  private slots:
      void createDockers();
  };
  
  // mainwindow.cpp
  MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
  {
      setDockOptions(dockOptions() |
                 QMainWindow::AllowTabbedDocks |
                 QMainWindow::GroupedDragging);
  
      // The following line of code does not change the situation.
      // setTabPosition(Qt::RightDockWidgetArea, QTabWidget::East);
  
      // There are some other codes which connect a button to the void createDockers() method
  }
  
  void createDockers()
  {
      Docker* dock = new Docker("Docker", this);
      dock-&gt;setFloating(true);
      dock-&gt;show();
  }
  </code></pre>
  
  <p>I am able to create two <code>Docker</code>s with clicks of the button mentioned above.
  <a href="https://i.stack.imgur.com/62XFs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/62XFs.png" alt="Two QDockWidgets"></a></p>
  
  <p>However, when I drag one <code>QDockWidget</code> onto the other, the border disappears and no tabs show up:
  <a href="https://i.stack.imgur.com/303B7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/303B7.png" alt="Merges QDockWidgets"></a></p>
  
  <p>I am expecting the following to happen: (Achieved by spawning several <code>QDockWidget</code>s)
  <a href="https://i.stack.imgur.com/lNfos.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lNfos.png" alt="Expected behaviour"></a>
  I am also noticing that one of the <code>QDockWidget</code>s did not vanish. Instead, it merged back to the <code>MainWindow</code>. This only happens if they are the "first two" <code>QDockWidget</code>s.</p>
  
  <p>What caused this problem and how to solve it? I am trying to mimic <a href="https://woboq.com/blog/qdockwidget-changes-in-56.html" rel="nofollow noreferrer">this project</a>.</p>