wrong maximumSize for spacer items without stretch fixed
This commit is contained in:
parent
2b84276019
commit
8a9db8ed10
@ -75,11 +75,24 @@ QSizeF QskLayoutItem::sizeHint(
|
||||
|
||||
if ( m_item == nullptr )
|
||||
{
|
||||
if ( m_isStretchable && whichHint == Qt::MaximumSize )
|
||||
return QSizeF( QskLayoutConstraint::unlimited, QskLayoutConstraint::unlimited );
|
||||
|
||||
// a spacer item
|
||||
return m_spacingHint;
|
||||
if ( whichHint == Qt::MaximumSize )
|
||||
{
|
||||
if ( m_isStretchable )
|
||||
return QSizeF( QskLayoutConstraint::unlimited, QskLayoutConstraint::unlimited );
|
||||
|
||||
if ( m_spacingHint.width() < 0 )
|
||||
return QSizeF( QskLayoutConstraint::unlimited, m_spacingHint.height() );
|
||||
else
|
||||
return QSizeF( m_spacingHint.width(), QskLayoutConstraint::unlimited );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_spacingHint.width() < 0 )
|
||||
return QSizeF( 0, m_spacingHint.height() );
|
||||
else
|
||||
return QSizeF( m_spacingHint.width(), 0 );
|
||||
}
|
||||
}
|
||||
|
||||
QSizeF hint( 0, 0 );
|
||||
|
@ -183,9 +183,9 @@ void QskLinearBox::insertSpacer( int index, qreal spacing, int stretchFactor )
|
||||
|
||||
QskLayoutItem* layoutItem;
|
||||
if ( m_data->orientation == Qt::Horizontal )
|
||||
layoutItem = new QskLayoutItem( QSizeF( spacing, 0 ), stretchFactor, 0, 0 );
|
||||
layoutItem = new QskLayoutItem( QSizeF( spacing, -1.0 ), stretchFactor, 0, 0 );
|
||||
else
|
||||
layoutItem = new QskLayoutItem( QSizeF( 0, spacing ), stretchFactor, 0, 0 );
|
||||
layoutItem = new QskLayoutItem( QSizeF( -1.0, spacing ), stretchFactor, 0, 0 );
|
||||
|
||||
#if 1
|
||||
if ( stretchFactor >= 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user