QmlMaterial 0.1.0
Loading...
Searching...
No Matches
lazy_grid.hpp
1#pragma once
2
3#include "qml_material/view/lazy_view.hpp"
4
5namespace qml_material
6{
7class QML_MATERIAL_API LazyGrid : public LazyView {
8 Q_OBJECT
9 QML_ELEMENT
10 // Zero fixedSlotCount selects adaptive sizing; fixed counts divide the available cross axis.
11 Q_PROPERTY(int fixedSlotCount READ fixedSlotCount WRITE setFixedSlotCount NOTIFY
12 fixedSlotCountChanged FINAL)
13 Q_PROPERTY(qreal minimumCellExtent READ minimumCellExtent WRITE setMinimumCellExtent NOTIFY
14 minimumCellExtentChanged FINAL)
15 Q_PROPERTY(qreal itemExtent READ itemExtent WRITE setItemExtent NOTIFY itemExtentChanged FINAL)
16 Q_PROPERTY(
17 qreal mainSpacing READ mainSpacing WRITE setMainSpacing NOTIFY mainSpacingChanged FINAL)
18 Q_PROPERTY(
19 qreal crossSpacing READ crossSpacing WRITE setCrossSpacing NOTIFY crossSpacingChanged FINAL)
20 Q_PROPERTY(int slotCount READ slotCount NOTIFY layoutChanged FINAL)
21 Q_PROPERTY(qreal cellCrossExtent READ cellCrossExtent NOTIFY layoutChanged FINAL)
22 Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection
23 NOTIFY layoutDirectionChanged FINAL)
24public:
25 explicit LazyGrid(QQuickItem* parent = nullptr);
26 int fixedSlotCount() const;
27 void setFixedSlotCount(int);
28 qreal minimumCellExtent() const;
29 void setMinimumCellExtent(qreal);
30 qreal itemExtent() const;
31 void setItemExtent(qreal);
32 qreal mainSpacing() const;
33 void setMainSpacing(qreal);
34 qreal crossSpacing() const;
35 void setCrossSpacing(qreal);
36 int slotCount() const;
37 qreal cellCrossExtent() const;
38 Qt::LayoutDirection layoutDirection() const;
39 void setLayoutDirection(Qt::LayoutDirection);
40 Q_SIGNAL void fixedSlotCountChanged();
41 Q_SIGNAL void minimumCellExtentChanged();
42 Q_SIGNAL void itemExtentChanged();
43 Q_SIGNAL void mainSpacingChanged();
44 Q_SIGNAL void crossSpacingChanged();
45 Q_SIGNAL void layoutDirectionChanged();
46};
47} // namespace qml_material