diff options
Diffstat (limited to 'src/quicktemplates2/qquicktumbler_p_p.h')
-rw-r--r-- | src/quicktemplates2/qquicktumbler_p_p.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquicktumbler_p_p.h b/src/quicktemplates2/qquicktumbler_p_p.h index 0dcae762..fe8a4ad2 100644 --- a/src/quicktemplates2/qquicktumbler_p_p.h +++ b/src/quicktemplates2/qquicktumbler_p_p.h @@ -50,11 +50,10 @@ #include <QtQuick/private/qquickitemchangelistener_p.h> #include <QtQuickTemplates2/private/qquickcontrol_p_p.h> +#include <QtQuickTemplates2/private/qquicktumbler_p.h> QT_BEGIN_NAMESPACE -class QQuickTumbler; - class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTumblerPrivate : public QQuickControlPrivate, public QQuickItemChangeListener { Q_DECLARE_PUBLIC(QQuickTumbler) @@ -84,6 +83,10 @@ public: QQuickItem *view; QQuickItem *viewContentItem; ContentItemType viewContentItemType; + union { + qreal viewOffset; // PathView + qreal viewContentY; // ListView + }; int currentIndex; int pendingCurrentIndex; bool ignoreCurrentIndexChanges; @@ -94,6 +97,10 @@ public: void _q_updateItemWidths(); void _q_onViewCurrentIndexChanged(); void _q_onViewCountChanged(); + void _q_onViewOffsetChanged(); + void _q_onViewContentYChanged(); + + void calculateDisplacements(); void disconnectFromView(); void setupViewData(QQuickItem *newControlContentItem); @@ -107,6 +114,32 @@ public: void itemChildAdded(QQuickItem *, QQuickItem *) override; void itemChildRemoved(QQuickItem *, QQuickItem *) override; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange , const QRectF &) override; +}; + +class QQuickTumblerAttachedPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QQuickTumblerAttached) + +public: + QQuickTumblerAttachedPrivate(); + + static QQuickTumblerAttachedPrivate *get(QQuickTumblerAttached *attached) + { + return attached->d_func(); + } + + void init(QQuickItem *delegateItem); + + void calculateDisplacement(); + void emitIfDisplacementChanged(qreal oldDisplacement, qreal newDisplacement); + + // The Tumbler that contains the delegate. Required to calculated the displacement. + QPointer<QQuickTumbler> tumbler; + // The index of the delegate. Used to calculate the displacement. + int index; + // The displacement for our delegate. + qreal displacement; }; QT_END_NAMESPACE |