diff --git a/src/controls/QskTabView.cpp b/src/controls/QskTabView.cpp index 5e969da3..f7e037a3 100644 --- a/src/controls/QskTabView.cpp +++ b/src/controls/QskTabView.cpp @@ -201,7 +201,7 @@ int QskTabView::count() const QSizeF QskTabView::layoutSizeHint( Qt::SizeHint which, const QSizeF& constraint ) const { - if ( which != Qt::PreferredSize ) + if ( which == Qt::MaximumSize ) return QSizeF(); const auto& tabBar = m_data->tabBar; @@ -253,7 +253,7 @@ QSizeF QskTabView::layoutSizeHint( } else { - const auto boxHint = stackBox->sizeConstraint(); + const auto boxHint = stackBox->sizeConstraint( which ); hint.rwidth() = barHint.width() + boxHint.width(); hint.rheight() = qMax( barHint.height(), boxHint.height() ); diff --git a/src/layouts/QskStackBox.cpp b/src/layouts/QskStackBox.cpp index 16d740ab..7aa07132 100644 --- a/src/layouts/QskStackBox.cpp +++ b/src/layouts/QskStackBox.cpp @@ -348,6 +348,7 @@ QSizeF QskStackBox::layoutSizeHint( Qt::SizeHint which, const QSizeF& constraint ) const { // needs to reimplemented TODO ... + // minimum/preferred layout hint need to be cached if ( which != Qt::PreferredSize ) return QSizeF(); @@ -361,8 +362,7 @@ QSizeF QskStackBox::layoutSizeHint( for ( const auto& item : qskAsConst( m_data->items ) ) { - const auto hint = qskEffectiveSizeHint( - item, Qt::PreferredSize, constraint ); + const auto hint = qskSizeConstraint( item, which, constraint ); if ( constraint.width() >= 0 ) value = qMax( hint.height(), value );