spacer -> spacing

This commit is contained in:
Uwe Rathmann 2019-09-16 07:32:28 +02:00
parent 1571b1f59a
commit 5974b4115d
2 changed files with 20 additions and 18 deletions

View File

@ -162,7 +162,7 @@ namespace
Element& operator=( const Element& ); Element& operator=( const Element& );
qreal spacer() const; qreal spacing() const;
QQuickItem* item() const; QQuickItem* item() const;
QRect grid() const; QRect grid() const;
@ -180,7 +180,7 @@ namespace
union union
{ {
QQuickItem* m_item; QQuickItem* m_item;
qreal m_spacer; qreal m_spacing;
}; };
QRect m_grid; QRect m_grid;
@ -196,7 +196,7 @@ Element::Element( QQuickItem* item, const QRect& grid )
} }
Element::Element( qreal spacing, const QRect& grid ) Element::Element( qreal spacing, const QRect& grid )
: m_spacer( spacing ) : m_spacing( spacing )
, m_grid( grid ) , m_grid( grid )
, m_isSpacer( true ) , m_isSpacer( true )
{ {
@ -207,7 +207,7 @@ Element& Element::operator=( const Element& other )
m_isSpacer = other.m_isSpacer; m_isSpacer = other.m_isSpacer;
if ( other.m_isSpacer ) if ( other.m_isSpacer )
m_spacer = other.m_spacer; m_spacing = other.m_spacing;
else else
m_item = other.m_item; m_item = other.m_item;
@ -216,9 +216,9 @@ Element& Element::operator=( const Element& other )
return *this; return *this;
} }
inline qreal Element::spacer() const inline qreal Element::spacing() const
{ {
return m_isSpacer ? m_spacer : -1.0; return m_isSpacer ? m_spacing : -1.0;
} }
inline QQuickItem* Element::item() const inline QQuickItem* Element::item() const
@ -254,7 +254,9 @@ QskLayoutChain::CellData Element::cell( Qt::Orientation orientation ) const
if ( m_isSpacer ) if ( m_isSpacer )
{ {
// ??? cell.hint.setMinimum( m_spacing );
cell.hint.setPreferred( m_spacing );
cell.hint.setMaximum( m_spacing );
} }
else else
{ {
@ -496,7 +498,7 @@ QQuickItem* QskGridLayoutEngine::itemAt( int index ) const
qreal QskGridLayoutEngine::spacerAt( int index ) const qreal QskGridLayoutEngine::spacerAt( int index ) const
{ {
if ( const auto element = m_data->elementAt( index ) ) if ( const auto element = m_data->elementAt( index ) )
return element->spacer(); return element->spacing();
return -1.0; return -1.0;
} }

View File

@ -21,7 +21,7 @@ namespace
Element& operator=( const Element& ); Element& operator=( const Element& );
qreal spacer() const; qreal spacing() const;
QQuickItem* item() const; QQuickItem* item() const;
Qt::Alignment alignment() const; Qt::Alignment alignment() const;
@ -43,7 +43,7 @@ namespace
union union
{ {
QQuickItem* m_item; QQuickItem* m_item;
qreal m_spacer; qreal m_spacing;
}; };
int m_stretch = -1; int m_stretch = -1;
@ -58,7 +58,7 @@ Element::Element( QQuickItem* item )
} }
Element::Element( qreal spacing ) Element::Element( qreal spacing )
: m_spacer( spacing ) : m_spacing( spacing )
, m_isSpacer( true ) , m_isSpacer( true )
{ {
} }
@ -68,7 +68,7 @@ Element& Element::operator=( const Element& other )
m_isSpacer = other.m_isSpacer; m_isSpacer = other.m_isSpacer;
if ( other.m_isSpacer ) if ( other.m_isSpacer )
m_spacer = other.m_spacer; m_spacing = other.m_spacing;
else else
m_item = other.m_item; m_item = other.m_item;
@ -77,9 +77,9 @@ Element& Element::operator=( const Element& other )
return *this; return *this;
} }
inline qreal Element::spacer() const inline qreal Element::spacing() const
{ {
return m_isSpacer ? m_spacer : -1.0; return m_isSpacer ? m_spacing : -1.0;
} }
inline QQuickItem* Element::item() const inline QQuickItem* Element::item() const
@ -127,11 +127,11 @@ QskLayoutChain::CellData Element::cell(
{ {
if ( isLayoutOrientation ) if ( isLayoutOrientation )
{ {
cell.hint.setMinimum( m_spacer ); cell.hint.setMinimum( m_spacing );
cell.hint.setPreferred( m_spacer ); cell.hint.setPreferred( m_spacing );
if ( m_stretch <= 0 ) if ( m_stretch <= 0 )
cell.hint.setMaximum( m_spacer ); cell.hint.setMaximum( m_spacing );
cell.stretch = qMax( m_stretch, 0 ); cell.stretch = qMax( m_stretch, 0 );
} }
@ -331,7 +331,7 @@ QQuickItem* QskLinearLayoutEngine::itemAt( int index ) const
qreal QskLinearLayoutEngine::spacerAt( int index ) const qreal QskLinearLayoutEngine::spacerAt( int index ) const
{ {
if ( const auto element = m_data->elementAt( index ) ) if ( const auto element = m_data->elementAt( index ) )
return element->spacer(); return element->spacing();
return -1.0; return -1.0;
} }