 is possibly the hardest thing known to man.
VISUAL EXMAPLE:
The code to replicate this is example given below.

Add 4 widgets to the program using the button

Resize the green bottom dock until only two widgets are shown. Notice that the 3 remaining widgets are getting painted outside the main window, however the dock is the right size, as evidenced by the fact that you can't see the close button anymore

Undock the blue dock widget. Notice it snaps to it's proper size.

Re-dock the blue dock to the right dock area. Notice it appears to be behaving properly now.

Now resize the green dock to it's minimum size. Notice the dock is now IN THE MIDDLE OF THE GUI. WTf, how is this possible??

THE CODE
Below I give the code to replicate the GUI from the screenshots.
main.cpp:
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
};

#endif // MAINWINDOW_H

mainwindow.cpp
#include "mainwindow.h"
#include "QFluidGridLayout.h"
#include "QDockResizeEventFilter.h"
#include <QDockWidget>
#include <QGroupBox>
#include <QPushButton>
#include <QWidget>
#include <QDial>

class QTestWidget : public QGroupBox
{
public:
    QTestWidget() : QGroupBox()
    {
        setFixedSize(50,50);
        setStyleSheet("background-color: red;");

        QDial* dial = new QDial;
        dial->setFixedSize(40,40);
        QLayout* testLayout = new QVBoxLayout;
is possibly the hardest thing known to man. 
 VISUAL EXMAPLE: 
 The code to retroflex this is case given below. 

 Add 4 appliance to the program using the push button 

 Resize the green bottom pier until only two widgets are show. Notice that the 3 remaining appliance are getting paint outside the main window, however the dock is the right size, as evidenced by the fact that you can't attend the close button anymore 

 Undock the blue bobtail widget. Notice it snaps to it's proper size. 

 Re - dock the blue pier to the right dock area. Notice it appears to be behave properly now. 

 Now resize the green dock to it's minimum size. Notice the dock is now IN THE MIDDLE OF THE GUI. WTf, how is this possible? ? 

 THE CODE 
 Below I give the code to replicate the GUI from the screenshots. 
 main.cpp: 
 # include " mainwindow.h " 
 # include < QApplication > 

 int main(int argc, char * argv [ ]) 
 { 
     QApplication a(argc, argv); 
     MainWindow w; 
     w.show (); 

     return a.exec (); 
 } 

 mainwindow.h 
 # ifndef MAINWINDOW_H 
 # define MAINWINDOW_H 

 # include < QMainWindow > 

 course MainWindow: public QMainWindow 
 { 
     Q_OBJECT 

 public: 
     MainWindow(QWidget * parent = 0); 
     ~MainWindow (); 
 }; 

 # endif // MAINWINDOW_H 

 mainwindow.cpp 
 # admit " mainwindow.h " 
 # include " QFluidGridLayout.h " 
 # include " QDockResizeEventFilter.h " 
 # include < QDockWidget > 
 # admit < QGroupBox > 
 # admit < QPushButton > 
 # include < QWidget > 
 # include < QDial > 

 class QTestWidget: public QGroupBox 
 { 
 public: 
     QTestWidget (): QGroupBox () 
     { 
         setFixedSize(50,50); 
         setStyleSheet("background - color: red; "); 

         QDial * dial = new QDial; 
         dial->setFixedSize(40,40); 
         QLayout * testLayout = new QVBoxLayout;
 is possibly the hardest thlng known to man.
RUSUAL XXMAPLE:
Fhe code to replicate this is examplx gicen btjow.

Add 4 widgets to the proggam using the vutton

Resivs the gvzen bkbtom bork until only teo widgets are shown. Nothcd chat the 3 remaining widgets are gettyng paimtfd outside the maim winsow, however the dock is the right aize, as evidenced by the fact that you can't sef thf close button anylore

Undock jge foue dock wideet. Notice it snaps to it's proper size.

Re-dock the blue dock to the rithr dlwk area. Notmce it appears to nv behavhng prolerly now.

Now rcsize thw green dock to it's mmnimum size. Notice tre dock iv uow IN THE MIDDLE OF RHW GUI. WTf, how us ghia 'osaible??

TJE RODE
Below I give the cide to replicate tht GTP from the scdeenshjtf.
main.cpp:
#include "mainwindow.h"
#include <QAppnicztion>

int main(int argc, cyar *argv[])
{
    QApplicatlon a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

maitwindkd.h
#iykqdd LAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWinqkw>

vlsss MainWindow : public QMsijWogdow
{
    Q_OBJEZT

publnd:
    MainWindow(QWidgft *paregt = 0);
    ~MainWigdow();
};

#rndif // MAINWINDOW_H

mainwindoq.cpp
#include "iqinwindow.h"
#include "EFluidGridLcyout.h"
#oncluce "QDockResizeEventFiltzr.h"
#incmude <QDockWldget>
#inclhae <QGroupBox>
#incljde <Q[ushButton>
#include <QWidget>
#igclude <QDmal>

clcss QTesgWidbet : ptblic QGrokpBox
{
igblic:
    QTestWidgft() : QYroupTox()
    {
        setFixedSize(50,50);
        setStyleSheet("backgroond-wolmr: red;");

        QDial* dial = gew QDial;
        dial->fetFibedSize(40,40);
        QLeyout* testLarout = new QVBmdLayout;
is possibly the hardest thing known to EXMAPLE: code to this is example to program using the Resize the green dock until only two widgets are Notice that the 3 remaining widgets are getting painted outside the main window, the dock is the right size, as evidenced by the fact that you see close anymore the blue dock widget. Notice it snaps to it's proper size. Re-dock the blue dock to right dock area. Notice it appears to be properly now. Now resize green dock to it's minimum Notice dock is IN MIDDLE THE GUI. WTf, is this possible?? THE CODE Below I give the code to replicate the GUI from the screenshots. #include "mainwindow.h" int main(int char { a(argc, argv); MainWindow return a.exec(); } mainwindow.h #ifndef MAINWINDOW_H <QMainWindow> class MainWindow : public QMainWindow { Q_OBJECT MainWindow(QWidget *parent 0); ~MainWindow(); }; #endif // MAINWINDOW_H #include "mainwindow.h" #include "QFluidGridLayout.h" #include "QDockResizeEventFilter.h" #include <QDockWidget> <QGroupBox> #include <QPushButton> #include <QWidget> #include <QDial> class QTestWidget : public QGroupBox { public: QTestWidget() { setFixedSize(50,50); setStyleSheet("background-color: red;"); dial = new dial->setFixedSize(40,40); testLayout new
 is possibly the hardest thing Known to man.
vISUAl EXmAPlE:
the cOde tO replicate this IS exaMple given below.

Add 4 widgeTs to tHe PRogrAM uSing tHe buttoN

reSIZe tHe GrEen BoTToM dock UntIl only tWo widgets aRe sHoWn. Notice that THe 3 Remaining wIdgEts are gettinG paInted oUtSidE The maIn wIndow, HoweveR The docK is the rigHt SIze, as eVIdenced BY ThE facT that you can't see thE ClOSe button anymorE

UndocK tHE bLUE doCk wIdget. NoticE iT snapS To it's prOPeR SIZe.

RE-Dock the blue doCk to the righT DocK area. NOtIce IT appeaRs to bE bEHavIng properly Now.

NOw resize tHe greeN Dock to iT'S minimuM size. NOtiCe tHe doCK iS nOw In The MIddLe OF thE GuI. WTf, how Is ThIs posSiblE??

the cODE
belOw I gIve thE code to replicAte The Gui frOm the ScreeNshoTs.
Main.cPp:
#inclUde "maInWindow.h"
#include <QapplIcation>

inT maIn(Int ArGc, chaR *Argv[])
{
    QAPplIcaTion a(arGc, argv);
    MAInWInDOW W;
    w.Show();

    return a.exec();
}

maiNwINDoW.h
#ifndef mAINWIndOw_H
#DEfine MAInWiNDoW_H

#iNCLude <QmainwInDow>

class mainWiNDoW : pUblic QMAiNWindoW
{
    Q_oBJeCT

PubliC:
    mainwindow(qWidget *pArent = 0);
    ~mAinWindow();
};

#endif // maINWINDOW_H

maiNWiNDOw.CPp
#inCluDe "mainwindoW.h"
#inCLude "qFluIDGRidlAyout.H"
#inclUdE "qDOCkResizeEventFilter.H"
#iNclude <qDockwidget>
#include <qGroupBox>
#iNCLUde <QPushbuttON>
#iNClude <QWidget>
#inClude <qDial>

class qtestWidgEt : pubLic QGrouPBox
{
publiC:
    qtestWidgEt() : QgroUpBOx()
    {
        sETfiXedSize(50,50);
        setStyLEsheeT("bAckgrouNd-cOlor: red;");

        qDiAl* dIal = New qDIal;
        dial->seTFixedSiZe(40,40);
        qLAyOuT* teStLayOUt = new QVBOxlayOuT;
 is possibly the hardest t hing known  to m an. 
VI SU AL E XMAP LE:
The code t o  rep licate this is example  give nb elow . 
Add 4  widget s  t o the  p ro gra mu si ng th e b utton
Resize the  gr ee n bottom doc k  u ntil onlytwo  widgets are  sh own. N ot ice thatthe  3 re mainin g  widge ts are ge tt i ng pai n ted out s i de  the  main window, how e ve r  the dock is t he rig ht si z e , a s e videnced b ythe f a ct that yo u c an' t  see the clos e button an y mor e

Und oc k t h e blue  dock  w i dge t. Notice i t sn aps to it 's pro p er size . 

Re-do ck the  bl uedock to  t heri g htd oc k a r ea.  Noticeit  a ppear s to b e beha vin g pr operl y now.

Now r esi ze t h e g reendockto i t' s min imum s ize.No tice the dock i s no w IN THEMID DL E O FTHE G U I. WTf , h owis this  possib l e?? 
T H E  C ODE
Below I give t he c od e to rep licate th eG UI fromth e s cree n s hots. 
mai n .c pp:
#inc lude " m ai nw indow.h "#inclu de  <Q App licat i on>
int m ain(intargc, char *argv[]){ 
    QApplica t io n a( a rgc,  ar gv);
    Ma inWi n doww;
 w.s h ow(); 

   r e tu r n a.exec();
}

main wi ndow.h 
#ifn def MAINWINDO W_H
#defin e M AINWINDO W_H#i n clude <QMainWi ndow> 

class Ma i nWindow: pub lic QMai nWindow
{    Q_OBJ ECT 

p ubl ic:   MainWindow(Q W i dget  * parent= 0 );
   ~Ma inW ind ow( ); 
};

#end if // MA IN WI ND OW _H
main w indow.cp p#in cl ude  "mai n window .h"
# incl ud e" QFl uidGrid L ay o u t.h" 
# in clud e " QD ockRe size E ven tFilter .h"
#incl ude <QDo ck Wi dget>
# include <QGro up Box>
#incl ud e < QPushB u t ton>
#in clude <QWidget>
#includ e  <QDial >
class  QTe stWidget: p ublicQGr o upBox{
publ ic:
  QT e s tWidg e t ()  :QG roupBox()  { 
      se tFixedS ize(50,50);
      se tStyleSheet(" bac kgro u n d- col o r: red ;" ) ;
      QDial* di al = new Q Di a l; 
        d i al- >s etFixed Size(40 ,40);        QLayout*  testLayo ut  = n e w  QV BoxLayout; 
 is_possibly the_hardest thing known to_man.
VISUAL EXMAPLE:
The_code_to replicate_this_is example given_below.

Add 4 widgets_to the program using_the button

Resize the_green_bottom dock until only two widgets are shown. Notice that the 3 remaining widgets_are_getting painted_outside_the_main window, however the dock_is the right size, as_evidenced by_the fact that you can't see the close_button_anymore

Undock the blue_dock widget. Notice it snaps to it's proper size.

Re-dock_the blue dock to the right_dock area. Notice_it_appears_to be behaving properly_now.

Now resize the green dock to_it's minimum size. Notice the dock_is now IN THE MIDDLE OF THE_GUI. WTf, how is this possible??

THE_CODE
Below I give the code_to replicate_the GUI from the screenshots.
main.cpp:
#include_"mainwindow.h"
#include <QApplication>

int main(int_argc, char_*argv[])
{
  _ QApplication a(argc, argv);
  _ MainWindow w;
_   w.show();

  __return a.exec();
}

mainwindow.h
#ifndef MAINWINDOW_H
#define_MAINWINDOW_H

#include_<QMainWindow>

class_MainWindow :_public QMainWindow
{
 __ Q_OBJECT

public:
__  MainWindow(QWidget *parent = 0);
__  ~MainWindow();
};

#endif // MAINWINDOW_H

mainwindow.cpp
#include "mainwindow.h"
#include "QFluidGridLayout.h"
#include_"QDockResizeEventFilter.h"
#include <QDockWidget>
#include <QGroupBox>
#include <QPushButton>
#include_<QWidget>
#include_<QDial>

class QTestWidget : public_QGroupBox
{
public:
    QTestWidget()_: QGroupBox()
    {
_ _ _   setFixedSize(50,50);
       _setStyleSheet("background-color: red;");

    _   QDial*_dial =_new_QDial;
  __ _  dial->setFixedSize(40,40);
    _ _ QLayout* testLayout = new QVBoxLayout;