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