calculation of size hints fixed

This commit is contained in:
Uwe Rathmann 2019-09-19 09:42:37 +02:00
parent fdea935991
commit fa26e10c0e
2 changed files with 4 additions and 4 deletions

View File

@ -201,7 +201,7 @@ int QskTabView::count() const
QSizeF QskTabView::layoutSizeHint( QSizeF QskTabView::layoutSizeHint(
Qt::SizeHint which, const QSizeF& constraint ) const Qt::SizeHint which, const QSizeF& constraint ) const
{ {
if ( which != Qt::PreferredSize ) if ( which == Qt::MaximumSize )
return QSizeF(); return QSizeF();
const auto& tabBar = m_data->tabBar; const auto& tabBar = m_data->tabBar;
@ -253,7 +253,7 @@ QSizeF QskTabView::layoutSizeHint(
} }
else else
{ {
const auto boxHint = stackBox->sizeConstraint(); const auto boxHint = stackBox->sizeConstraint( which );
hint.rwidth() = barHint.width() + boxHint.width(); hint.rwidth() = barHint.width() + boxHint.width();
hint.rheight() = qMax( barHint.height(), boxHint.height() ); hint.rheight() = qMax( barHint.height(), boxHint.height() );

View File

@ -348,6 +348,7 @@ QSizeF QskStackBox::layoutSizeHint(
Qt::SizeHint which, const QSizeF& constraint ) const Qt::SizeHint which, const QSizeF& constraint ) const
{ {
// needs to reimplemented TODO ... // needs to reimplemented TODO ...
// minimum/preferred layout hint need to be cached
if ( which != Qt::PreferredSize ) if ( which != Qt::PreferredSize )
return QSizeF(); return QSizeF();
@ -361,8 +362,7 @@ QSizeF QskStackBox::layoutSizeHint(
for ( const auto& item : qskAsConst( m_data->items ) ) for ( const auto& item : qskAsConst( m_data->items ) )
{ {
const auto hint = qskEffectiveSizeHint( const auto hint = qskSizeConstraint( item, which, constraint );
item, Qt::PreferredSize, constraint );
if ( constraint.width() >= 0 ) if ( constraint.width() >= 0 )
value = qMax( hint.height(), value ); value = qMax( hint.height(), value );