diff options
Diffstat (limited to 'src/widgets/kernel/qlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index 39c7f7ec3f..8688e011a0 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -608,6 +608,28 @@ void QLayout::childEvent(QChildEvent *e) \internal Also takes contentsMargins and menu bar into account. */ +int QLayout::totalMinimumHeightForWidth(int w) const +{ + Q_D(const QLayout); + int side=0, top=0; + if (d->topLevel) { + QWidget *parent = parentWidget(); + parent->ensurePolished(); + QWidgetPrivate *wd = parent->d_func(); + side += wd->leftmargin + wd->rightmargin; + top += wd->topmargin + wd->bottommargin; + } + int h = minimumHeightForWidth(w - side) + top; +#if QT_CONFIG(menubar) + h += menuBarHeightForWidth(d->menubar, w); +#endif + return h; +} + +/*! + \internal + Also takes contentsMargins and menu bar into account. +*/ int QLayout::totalHeightForWidth(int w) const { Q_D(const QLayout); |