return -1 for the constraining direction

This commit is contained in:
Uwe Rathmann 2019-09-14 15:41:34 +02:00
parent 1e733c4e5c
commit 13d2814bc9
2 changed files with 24 additions and 2 deletions

View File

@ -384,7 +384,18 @@ QSizeF QskGridBox::layoutSizeHint(
return QSizeF(); return QSizeF();
} }
return m_data->engine.sizeHint( which, constraint ); auto hint = m_data->engine.sizeHint( which, constraint );
if ( constraint.width() >= 0.0 )
{
hint.setWidth( -1.0 );
}
else if ( constraint.height() >= 0.0 )
{
hint.setHeight( -1.0 );
}
return hint;
} }
void QskGridBox::geometryChangeEvent( QskGeometryChangeEvent* event ) void QskGridBox::geometryChangeEvent( QskGeometryChangeEvent* event )

View File

@ -212,7 +212,18 @@ QSizeF QskLinearBox::layoutSizeHint(
return QSizeF(); return QSizeF();
} }
return m_data->engine.sizeHint( which, constraint ); auto hint = m_data->engine.sizeHint( which, constraint );
if ( constraint.width() >= 0.0 )
{
hint.setWidth( -1.0 );
}
else if ( constraint.height() >= 0.0 )
{
hint.setHeight( -1.0 );
}
return hint;
} }
void QskLinearBox::geometryChangeEvent( QskGeometryChangeEvent* event ) void QskLinearBox::geometryChangeEvent( QskGeometryChangeEvent* event )