15 Q_PROPERTY( Qt::Orientation orientation READ orientation
16 WRITE setOrientation NOTIFY orientationChanged FINAL )
18 Q_PROPERTY( uint dimension READ dimension
19 WRITE setDimension NOTIFY dimensionChanged FINAL )
21 Q_PROPERTY( qreal spacing READ spacing
22 WRITE setSpacing RESET resetSpacing NOTIFY spacingChanged FINAL )
24 Q_PROPERTY( Qt::Alignment defaultAlignment READ defaultAlignment
25 WRITE setDefaultAlignment NOTIFY defaultAlignmentChanged )
27 Q_PROPERTY( Qt::Edges extraSpacingAt READ extraSpacingAt
28 WRITE setExtraSpacingAt NOTIFY extraSpacingAtChanged )
30 Q_PROPERTY(
int elementCount READ elementCount )
31 Q_PROPERTY(
bool empty READ isEmpty() )
37 explicit
QskLinearBox( Qt::Orientation, QQuickItem* parent =
nullptr );
39 QskLinearBox( Qt::Orientation, uint dimension, QQuickItem* parent =
nullptr );
43 int elementCount() const;
45 qreal spacingAtIndex(
int index ) const;
47 QQuickItem* itemAtIndex(
int index ) const;
48 int indexOf( const QQuickItem* ) const;
50 void removeItem( const QQuickItem* );
51 void removeAt(
int index );
53 Qt::Orientation orientation() const;
54 void setOrientation( Qt::Orientation );
56 void setDimension( uint );
57 uint dimension() const;
59 void setExtraSpacingAt( Qt::Edges );
60 Qt::Edges extraSpacingAt() const;
62 void setDefaultAlignment( Qt::Alignment );
63 Qt::Alignment defaultAlignment() const;
65 void setSpacing( qreal spacing );
67 qreal spacing() const;
69 Q_INVOKABLE
int addItem( QQuickItem* );
70 int addItem( QQuickItem*, Qt::Alignment );
72 Q_INVOKABLE
int insertItem(
int index, QQuickItem* );
73 int insertItem(
int index, QQuickItem*, Qt::Alignment );
75 Q_INVOKABLE
int addSpacer( qreal spacing,
int stretchFactor = 0 );
76 Q_INVOKABLE
int insertSpacer(
int index, qreal spacing,
int stretchFactor = 0 );
78 Q_INVOKABLE
int addStretch(
int stretchFactor = 0 );
79 Q_INVOKABLE
int insertStretch(
int index,
int stretchFactor = 0 );
81 Q_INVOKABLE
void setStretchFactor(
int index,
int stretchFactor );
82 Q_INVOKABLE
int stretchFactor(
int index ) const;
84 void setStretchFactor( const QQuickItem*,
int stretchFactor );
85 int stretchFactor( const QQuickItem* ) const;
93 void clear(
bool autoDelete = false );
96 void orientationChanged();
97 void dimensionChanged();
98 void defaultAlignmentChanged();
99 void spacingChanged();
100 void extraSpacingAtChanged();
103 bool event( QEvent* ) override;
106 void itemChange( ItemChange, const ItemChangeData& ) override;
107 void updateLayout() override;
109 QSizeF layoutSizeHint( Qt::SizeHint, const QSizeF& ) const override;
112 void autoAddItem( QQuickItem* ) override final;
113 void autoRemoveItem( QQuickItem* ) override final;
115 void setItemActive( QQuickItem*,
bool );
116 void removeItemInternal(
int index,
bool unparent );
119 std::unique_ptr< PrivateData > m_data;