3#include "qml_material/scrollable/flickable.hpp"
4#include "qml_material/model/item_source.hpp"
5#include <QQmlComponent>
11class QML_MATERIAL_API LazyList :
public Flickable {
14 Q_PROPERTY(ItemSource* source READ source WRITE setSource NOTIFY sourceChanged FINAL)
15 Q_PROPERTY(QQmlComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
16 Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged FINAL)
18 qreal cacheExtent READ cacheExtent WRITE setCacheExtent NOTIFY cacheExtentChanged FINAL)
19 Q_PROPERTY(qreal estimatedItemExtent READ estimatedItemExtent WRITE setEstimatedItemExtent
20 NOTIFY estimatedItemExtentChanged FINAL)
21 Q_PROPERTY(
int poolLimit READ poolLimit WRITE setPoolLimit NOTIFY poolLimitChanged FINAL)
22 Q_PROPERTY(
int count READ count NOTIFY layoutChanged FINAL)
23 Q_PROPERTY(
int firstVisibleIndex READ firstVisibleIndex NOTIFY layoutChanged FINAL)
24 Q_PROPERTY(
int lastVisibleIndex READ lastVisibleIndex NOTIFY layoutChanged FINAL)
25 Q_PROPERTY(
int liveCount READ liveCount NOTIFY layoutChanged FINAL)
26 Q_PROPERTY(
bool estimatedContentHeight READ estimatedContentHeight NOTIFY layoutChanged FINAL)
27 Q_PROPERTY(QString errorString READ errorString NOTIFY layoutChanged FINAL)
28 Q_PROPERTY(
bool positioning READ positioning NOTIFY positioningChanged FINAL)
36 explicit LazyList(QQuickItem* parent =
nullptr);
38 ItemSource* source()
const;
39 void setSource(ItemSource*);
40 QQmlComponent* delegate()
const;
41 void setDelegate(QQmlComponent*);
42 qreal spacing()
const;
43 void setSpacing(qreal);
44 qreal cacheExtent()
const;
45 void setCacheExtent(qreal);
46 qreal estimatedItemExtent()
const;
47 void setEstimatedItemExtent(qreal);
48 int poolLimit()
const;
49 void setPoolLimit(
int);
51 int firstVisibleIndex()
const;
52 int lastVisibleIndex()
const;
53 int liveCount()
const;
54 bool estimatedContentHeight()
const;
55 QString errorString()
const;
56 Q_INVOKABLE
bool positionAtKey(
const QString&, qreal alignment = 0, qreal offset = 0,
57 PositionMode mode = Immediate);
58 Q_INVOKABLE
bool positionAtIndex(
int index, qreal alignment = 0, qreal offset = 0,
59 PositionMode mode = Immediate);
60 bool positioning()
const;
61 void setContentY(qreal)
override;
62 Q_SIGNAL
void positioningChanged();
63 Q_SIGNAL
void positioningFinished(
const QString& key,
bool success);
64 Q_SIGNAL
void sourceChanged();
65 Q_SIGNAL
void delegateChanged();
66 Q_SIGNAL
void spacingChanged();
67 Q_SIGNAL
void cacheExtentChanged();
68 Q_SIGNAL
void estimatedItemExtentChanged();
69 Q_SIGNAL
void poolLimitChanged();
70 Q_SIGNAL
void layoutChanged();
73 void updatePolish()
override;
74 void componentComplete()
override;
75 void geometryChange(
const QRectF&,
const QRectF&)
override;
76 void viewportMoved(Qt::Orientations)
override;
77 void scrollInputStarted()
override;
78 void scrollActivityCancelled()
override;
81 void scheduleLayout();
82 void finishPositioning(
bool success);
84 std::shared_ptr<Private> d;