Hallo,
i'm trying to convince a QDockWidget to resize itself to a proper size, but it alway takes away half of the window size. (at the bottom)
It would be perfect if the QDockWidget resized itself always in a certain relation to the total size of the Window (as 1/4).
I tried this, but it didn't help. A resize() also doesn't have any effect (I think because of the QLayout)
EDIT: think of setVerticalPolicy where there's setHorizontalPolicy down there. It doesn't make any sense in the other way. What do I need to set for SizePolicy if I want him to use VerticalStretch?
sizePolicy2.setVerticalStretch(3);
sizePolicy2.
setHorizontalPolicy(QSizePolicy::Expanding);
centralWidget2->setSizePolicy(sizePolicy2);
//chat erstellen
dockwidget->setAllowedAreas(Qt::AllDockWidgetAreas);
addDockWidget(Qt::BottomDockWidgetArea, dockwidget);
chatwidget=new Chat(dockwidget);
dockwidget->setWidget(chatwidget);
//sizePolicy.setHorizontalStretch(3);
sizePolicy.setVerticalStretch(1);
dockwidget->setSizePolicy(sizePolicy);
QSizePolicy sizePolicy2;
sizePolicy2.setVerticalStretch(3);
sizePolicy2.setHorizontalPolicy(QSizePolicy::Expanding);
centralWidget2->setSizePolicy(sizePolicy2);
//chat erstellen
dockwidget=new QDockWidget(this);
dockwidget->setAllowedAreas(Qt::AllDockWidgetAreas);
addDockWidget(Qt::BottomDockWidgetArea, dockwidget);
chatwidget=new Chat(dockwidget);
dockwidget->setWidget(chatwidget);
QSizePolicy sizePolicy;
//sizePolicy.setHorizontalStretch(3);
sizePolicy.setHorizontalPolicy(QSizePolicy::Minimum);
sizePolicy.setVerticalStretch(1);
dockwidget->setSizePolicy(sizePolicy);
To copy to clipboard, switch view to plain text mode
Thanks,
Andre
Bookmarks