Make DockWidgetQuick::minimumSize()/max virtual

While for QtWidgets we have layouts which propagate the constraints
up, for QtQuick we don't, so we need to override minimumSize instead
This commit is contained in:
Sergio Martins
2020-11-21 18:15:37 +00:00
parent a847a574ed
commit 801e49de9d
5 changed files with 49 additions and 6 deletions

View File

@@ -87,3 +87,23 @@ bool DockWidgetQuick::event(QEvent *e)
return DockWidgetBase::event(e);
}
QSize DockWidgetQuick::minimumSize() const
{
if (QWidgetAdapter *guestWidget = widget()) {
// The guests min-size is the same as the widget's, there's no spacing or margins.
return guestWidget->minimumSize();
}
return DockWidgetBase::minimumSize();
}
QSize DockWidgetQuick::maximumSize() const
{
if (QWidgetAdapter *guestWidget = widget()) {
// The guests max-size is the same as the widget's, there's no spacing or margins.
return guestWidget->maximumSize();
}
return DockWidgetBase::maximumSize();
}