I added a new QDockWidget as all the other ones I already have. However this time the Widget is not resized within the QDockWidget, as if it had not layout.

It is created with this code:
Qt Code:
  1. dockAppMessages = new QDockWidget(this);
  2. dockAppMessages->setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea);
  3. widgetDockErrorMessageImpl = new widgetDockErrorMessage(dockAppMessages);
  4. dockAppMessages->setWidget(widgetDockPhaseShapesImpl);
  5. dockAppMessages->setWindowTitle("Application Messages");
  6. addDockWidget(Qt::BottomDockWidgetArea , dockAppMessages);
  7. menuView->addAction(dockAppMessages->toggleViewAction());
To copy to clipboard, switch view to plain text mode 

widgetDockErrorMessage, the widget displayed within QDockWidget has a Layout, set to Expanding.

The ui file is the following
Qt Code:
  1. void setupUi(QWidget *widgetDockErrorMessage)
  2. {
  3. if (widgetDockErrorMessage->objectName().isEmpty())
  4. widgetDockErrorMessage->setObjectName(QString::fromUtf8("widgetDockErrorMessage"));
  5. widgetDockErrorMessage->resize(499, 153);
  6. QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  7. sizePolicy.setHorizontalStretch(0);
  8. sizePolicy.setVerticalStretch(0);
  9. sizePolicy.setHeightForWidth(widgetDockErrorMessage->sizePolicy().hasHeightForWidth());
  10. widgetDockErrorMessage->setSizePolicy(sizePolicy);
  11. gridLayout = new QGridLayout(widgetDockErrorMessage);
  12. gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
  13. ErrorList = new WidgetListStringStack(widgetDockErrorMessage);
  14. ErrorList->setObjectName(QString::fromUtf8("ErrorList"));
  15. sizePolicy.setHeightForWidth(ErrorList->sizePolicy().hasHeightForWidth());
  16. ErrorList->setSizePolicy(sizePolicy);
  17.  
  18. gridLayout->addWidget(ErrorList, 0, 0, 1, 1);
  19.  
  20. horizontalLayout = new QHBoxLayout();
  21. horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
  22. horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
  23.  
  24. horizontalLayout->addItem(horizontalSpacer);
  25.  
  26. pushButtonClearList = new QPushButton(widgetDockErrorMessage);
  27. pushButtonClearList->setObjectName(QString::fromUtf8("pushButtonClearList"));
  28.  
  29. horizontalLayout->addWidget(pushButtonClearList);
  30.  
  31.  
  32. gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1);
  33.  
  34.  
  35. retranslateUi(widgetDockErrorMessage);
  36.  
  37. QMetaObject::connectSlotsByName(widgetDockErrorMessage);
  38. } // setupUi
To copy to clipboard, switch view to plain text mode 

Any ideas?

Matthias