15 Q_PROPERTY( Qt::Alignment defaultAlignment READ defaultAlignment
16 WRITE setDefaultAlignment NOTIFY defaultAlignmentChanged )
18 Q_PROPERTY(
bool empty READ isEmpty() )
19 Q_PROPERTY(
int elementCount READ elementCount )
24 explicit QskGridBox( QQuickItem* parent =
nullptr );
27 Q_INVOKABLE
int addItem( QQuickItem*,
28 int row,
int column,
int rowSpan,
int columnSpan );
30 Q_INVOKABLE
int addItem( QQuickItem*,
int row,
int column );
32 int addItem( QQuickItem*,
int row,
int column, Qt::Alignment );
34 int addItem( QQuickItem*,
int row,
int column,
35 int rowSpan,
int columnSpan, Qt::Alignment );
37 Q_INVOKABLE
int addSpacer(
const QSizeF&,
38 int row,
int column,
int rowSpan = 1,
int columnSpan = 1 );
40 int addColumnSpacer( qreal spacing,
int column );
41 int addRowSpacer( qreal spacing,
int row );
43 void removeItem(
const QQuickItem* );
44 void removeAt(
int index );
46 Q_INVOKABLE
int rowCount()
const;
47 Q_INVOKABLE
int columnCount()
const;
49 int elementCount()
const;
51 QQuickItem* itemAtIndex(
int index )
const;
52 int indexOf(
const QQuickItem* )
const;
56 Q_INVOKABLE QQuickItem* itemAt(
int row,
int column )
const;
57 Q_INVOKABLE
int indexAt(
int row,
int column )
const;
59 Q_INVOKABLE QRect gridOfIndex(
int index )
const;
60 Q_INVOKABLE QRect effectiveGridOfIndex(
int index )
const;
62 void setDefaultAlignment( Qt::Alignment );
63 Qt::Alignment defaultAlignment()
const;
65 void setSpacing( Qt::Orientations, qreal spacing );
66 void resetSpacing( Qt::Orientations );
67 qreal spacing( Qt::Orientation )
const;
69 void setSpacing( qreal spacing );
72 Q_INVOKABLE
void setRowStretchFactor(
int row,
int stretch );
73 Q_INVOKABLE
int rowStretchFactor(
int row )
const;
75 Q_INVOKABLE
void setColumnStretchFactor(
int column,
int stretch );
76 Q_INVOKABLE
int columnStretchFactor(
int column )
const;
80 Q_INVOKABLE
void setColumnWidthHint(
int column, Qt::SizeHint, qreal width );
81 Q_INVOKABLE qreal columnWidthHint(
int column, Qt::SizeHint )
const;
83 Q_INVOKABLE
void setRowHeightHint(
int row, Qt::SizeHint, qreal height );
84 Q_INVOKABLE qreal rowHeightHint(
int row, Qt::SizeHint )
const;
86 Q_INVOKABLE
void setRowFixedHeight(
int row, qreal height );
87 Q_INVOKABLE
void setColumnFixedWidth(
int column, qreal width );
93 void clear(
bool autoDelete =
false );
96 void defaultAlignmentChanged();
99 bool event( QEvent* )
override;
102 void itemChange( ItemChange,
const ItemChangeData& )
override;
103 void updateLayout()
override;
105 QSizeF layoutSizeHint( Qt::SizeHint,
const QSizeF& )
const override;
108 void setItemActive( QQuickItem*,
bool );
111 std::unique_ptr< PrivateData > m_data;
116 return addItem( item, row, column, 1, 1 );