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:
dockAppMessages->setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea);
widgetDockErrorMessageImpl = new widgetDockErrorMessage(dockAppMessages);
dockAppMessages->setWidget(widgetDockPhaseShapesImpl);
dockAppMessages->setWindowTitle("Application Messages");
addDockWidget(Qt::BottomDockWidgetArea , dockAppMessages);
menuView->addAction(dockAppMessages->toggleViewAction());
dockAppMessages = new QDockWidget(this);
dockAppMessages->setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea);
widgetDockErrorMessageImpl = new widgetDockErrorMessage(dockAppMessages);
dockAppMessages->setWidget(widgetDockPhaseShapesImpl);
dockAppMessages->setWindowTitle("Application Messages");
addDockWidget(Qt::BottomDockWidgetArea , dockAppMessages);
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
void setupUi
(QWidget *widgetDockErrorMessage
) {
if (widgetDockErrorMessage->objectName().isEmpty())
widgetDockErrorMessage
->setObjectName
(QString::fromUtf8("widgetDockErrorMessage"));
widgetDockErrorMessage->resize(499, 153);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(widgetDockErrorMessage->sizePolicy().hasHeightForWidth());
widgetDockErrorMessage->setSizePolicy(sizePolicy);
gridLayout
->setObjectName
(QString::fromUtf8("gridLayout"));
ErrorList = new WidgetListStringStack(widgetDockErrorMessage);
ErrorList
->setObjectName
(QString::fromUtf8("ErrorList"));
sizePolicy.setHeightForWidth(ErrorList->sizePolicy().hasHeightForWidth());
ErrorList->setSizePolicy(sizePolicy);
gridLayout->addWidget(ErrorList, 0, 0, 1, 1);
horizontalLayout
->setObjectName
(QString::fromUtf8("horizontalLayout"));
horizontalLayout->addItem(horizontalSpacer);
pushButtonClearList
= new QPushButton(widgetDockErrorMessage
);
pushButtonClearList
->setObjectName
(QString::fromUtf8("pushButtonClearList"));
horizontalLayout->addWidget(pushButtonClearList);
gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1);
retranslateUi(widgetDockErrorMessage);
QMetaObject::connectSlotsByName(widgetDockErrorMessage
);
} // setupUi
void setupUi(QWidget *widgetDockErrorMessage)
{
if (widgetDockErrorMessage->objectName().isEmpty())
widgetDockErrorMessage->setObjectName(QString::fromUtf8("widgetDockErrorMessage"));
widgetDockErrorMessage->resize(499, 153);
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(widgetDockErrorMessage->sizePolicy().hasHeightForWidth());
widgetDockErrorMessage->setSizePolicy(sizePolicy);
gridLayout = new QGridLayout(widgetDockErrorMessage);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
ErrorList = new WidgetListStringStack(widgetDockErrorMessage);
ErrorList->setObjectName(QString::fromUtf8("ErrorList"));
sizePolicy.setHeightForWidth(ErrorList->sizePolicy().hasHeightForWidth());
ErrorList->setSizePolicy(sizePolicy);
gridLayout->addWidget(ErrorList, 0, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout->addItem(horizontalSpacer);
pushButtonClearList = new QPushButton(widgetDockErrorMessage);
pushButtonClearList->setObjectName(QString::fromUtf8("pushButtonClearList"));
horizontalLayout->addWidget(pushButtonClearList);
gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1);
retranslateUi(widgetDockErrorMessage);
QMetaObject::connectSlotsByName(widgetDockErrorMessage);
} // setupUi
To copy to clipboard, switch view to plain text mode
Any ideas?
Matthias
Bookmarks