calculation of size hints fixed
This commit is contained in:
parent
fdea935991
commit
fa26e10c0e
|
@ -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() );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue