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(
|
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() );
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue