QskLinearBox::spacingAtIndex added
This commit is contained in:
parent
c1de001da4
commit
6838260606
@ -53,7 +53,7 @@ namespace
|
||||
{
|
||||
const int index = 0;
|
||||
|
||||
QQuickItem* item = itemAtIndex( index );
|
||||
auto item = itemAtIndex( index );
|
||||
removeAt( index );
|
||||
|
||||
if ( item == nullptr )
|
||||
|
@ -35,10 +35,7 @@ namespace
|
||||
addRectangle( "FireBrick" );
|
||||
addRectangle( "DarkRed" );
|
||||
|
||||
// setRowSpacing( 5, 30 );
|
||||
insertSpacer( 5, 30 );
|
||||
// insertStretch( 5, 2 );
|
||||
// setRetainSizeWhenHidden( 2, true );
|
||||
}
|
||||
|
||||
void mirror()
|
||||
@ -50,17 +47,16 @@ namespace
|
||||
{
|
||||
const int index = 0;
|
||||
|
||||
QQuickItem* item = itemAtIndex( index );
|
||||
removeAt( index );
|
||||
|
||||
if ( item == nullptr )
|
||||
if ( auto item = itemAtIndex( index ) )
|
||||
{
|
||||
// how to get the spacer item and its settings ???
|
||||
addSpacer( 30 );
|
||||
removeAt( index );
|
||||
addItem( item );
|
||||
}
|
||||
else
|
||||
{
|
||||
addItem( item );
|
||||
const auto spacing = spacingAtIndex( index );
|
||||
removeAt( index );
|
||||
addSpacer( spacing );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,11 @@ int QskLinearBox::entryCount() const
|
||||
return m_data->engine.count();
|
||||
}
|
||||
|
||||
int QskLinearBox::spacingAtIndex( int index ) const
|
||||
{
|
||||
return m_data->engine.spacerAt( index );
|
||||
}
|
||||
|
||||
QQuickItem* QskLinearBox::itemAtIndex( int index ) const
|
||||
{
|
||||
return m_data->engine.itemAt( index );
|
||||
|
@ -46,6 +46,8 @@ class QSK_EXPORT QskLinearBox : public QskIndexedLayoutBox
|
||||
int itemCount() const { return entryCount(); } // items and spacers
|
||||
#endif
|
||||
|
||||
int spacingAtIndex( int index ) const;
|
||||
|
||||
QQuickItem* itemAtIndex( int index ) const;
|
||||
int indexOf( const QQuickItem* ) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user