formal changes

This commit is contained in:
Uwe Rathmann 2018-11-25 10:56:09 +01:00
parent f3d6cdd669
commit cbc5d2b11f
3 changed files with 12 additions and 12 deletions

View File

@ -1247,7 +1247,7 @@ QSizeF QskControl::effectiveSizeHint( Qt::SizeHint whichHint ) const
if ( d_func()->blockedImplicitSize )
{
QskControl* that = const_cast< QskControl* >( this );
auto that = const_cast< QskControl* >( this );
that->updateImplicitSize();
}
@ -1805,7 +1805,7 @@ void QskControl::updateImplicitSize()
const auto dw = m.left() + m.right();
const auto dh = m.top() + m.bottom();
const QSizeF hint = contentsSizeHint();
const auto hint = contentsSizeHint();
const qreal w = ( hint.width() >= 0 ) ? dw + hint.width() : 0.0;
const qreal h = ( hint.height() >= 0 ) ? dh + hint.height() : 0.0;

View File

@ -10,26 +10,26 @@
QskLayoutItem::QskLayoutItem( QQuickItem* item, int row, int column, int rowSpan, int columnSpan )
: Inherited( row, column, qMax( rowSpan, 1 ), qMax( columnSpan, 1 ), Qt::Alignment() )
, m_item( item )
, m_isGeometryDirty( false )
, m_isStretchable( false )
, m_retainSizeWhenHidden( false )
, m_unlimitedRowSpan( rowSpan <= 0 )
, m_unlimitedColumnSpan( columnSpan <= 0 )
, m_updateMode( UpdateWhenVisible )
, m_item( item )
{
}
QskLayoutItem::QskLayoutItem( const QSizeF& size, int stretch, int row, int column )
: Inherited( row, column, 1, 1, Qt::Alignment() )
, m_item( nullptr )
, m_spacingHint( size )
, m_isGeometryDirty( false )
, m_isStretchable( stretch > 0 )
, m_retainSizeWhenHidden( false )
, m_unlimitedRowSpan( false )
, m_unlimitedColumnSpan( false )
, m_updateMode( UpdateWhenVisible )
, m_spacingHint( size )
, m_item( nullptr )
{
}
@ -150,8 +150,8 @@ QLayoutPolicy::Policy QskLayoutItem::sizePolicy( Qt::Orientation orientation ) c
const QSizeF hint = QskLayoutConstraint::effectiveConstraint( m_item, Qt::PreferredSize );
const qreal h = ( orientation == Qt::Horizontal ) ? hint.width() : hint.height();
if ( h <= 0 )
const qreal value = ( orientation == Qt::Horizontal ) ? hint.width() : hint.height();
if ( value <= 0 )
policy = QskSizePolicy::Ignored;
}
#endif
@ -194,9 +194,10 @@ Qt::Orientation QskLayoutItem::dynamicConstraintOrientation() const
{
Qt::Orientation orientation = Qt::Vertical;
if ( const QskControl* control = qobject_cast< const QskControl* >( m_item ) )
if ( auto control = qobject_cast< const QskControl* >( m_item ) )
{
const QskSizePolicy& policy = control->sizePolicy();
if ( policy.horizontalPolicy() == QskSizePolicy::Constrained )
return Qt::Horizontal;
else

View File

@ -66,16 +66,15 @@ class QskLayoutItem : public QGridLayoutItem
bool hasUnlimitedSpan( Qt::Orientation orientation ) const;
private:
QQuickItem* m_item;
QSizeF m_spacingHint;
bool m_isGeometryDirty : 1;
bool m_isStretchable : 1;
bool m_retainSizeWhenHidden : 1;
bool m_unlimitedRowSpan : 1;
bool m_unlimitedColumnSpan : 1;
UpdateMode m_updateMode : 2;
QSizeF m_spacingHint;
QQuickItem* m_item;
};
inline QQuickItem* QskLayoutItem::item()