5#ifndef QQUICKGRIDVIEW_P_H
6#define QQUICKGRIDVIEW_P_H
19#include <QtQuick/private/qtquickglobal_p.h>
32 Q_DECLARE_PRIVATE(QQuickGridView)
34 Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
35 Q_PROPERTY(qreal cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
36 Q_PROPERTY(qreal cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged)
38 Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged)
40 Q_CLASSINFO(
"DefaultProperty",
"data")
41 QML_NAMED_ELEMENT(GridView)
42 QML_ADDED_IN_VERSION(2, 0)
43 QML_ATTACHED(QQuickGridViewAttached)
47 FlowLeftToRight = LeftToRight,
48 FlowTopToBottom = TopToBottom
52 QQuickGridView(QQuickItem *parent=
nullptr);
54 void setHighlightFollowsCurrentItem(
bool) override;
55 void setHighlightMoveDuration(
int) override;
60 qreal cellWidth()
const;
61 void setCellWidth(qreal);
63 qreal cellHeight()
const;
64 void setCellHeight(qreal);
66 enum SnapMode { NoSnap, SnapToRow, SnapOneRow };
68 SnapMode snapMode()
const;
69 void setSnapMode(SnapMode mode);
71 static QQuickGridViewAttached *qmlAttachedProperties(QObject *);
74 void moveCurrentIndexUp();
75 void moveCurrentIndexDown();
76 void moveCurrentIndexLeft();
77 void moveCurrentIndexRight();
80 void cellWidthChanged();
81 void cellHeightChanged();
82 void highlightMoveDurationChanged();
84 void snapModeChanged();
87 void viewportMoved(Qt::Orientations) override;
88 void keyPressEvent(QKeyEvent *) override;
89 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
90 void initItem(
int index, QObject *item) override;
96 Q_PROPERTY(QQuickGridView *view READ view NOTIFY viewChanged FINAL)
qreal footerSize() const override
bool addVisibleItems(qreal fillFrom, qreal fillTo, qreal bufferFrom, qreal bufferTo, bool doBuffer) override
qreal snapPosAt(qreal pos) const
void fixupPosition() override
void updateViewport() override
void updateHighlight() override
bool showFooterForIndex(int index) const override
bool isContentFlowReversed() const override
bool flick(QQuickItemViewPrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QQuickTimeLineCallback::Callback fixupCallback, QEvent::Type eventType, qreal velocity) override
void repositionPackageItemAt(QQuickItem *item, int index) override
bool showHeaderForIndex(int index) const override
bool needsRefillForAddedOrRemovedIndex(int index) const override
void createHighlight(bool onDestruction=false) override
QSmoothedAnimation * highlightYAnimator
void initializeViewItem(FxViewItem *item) override
void removeItem(FxViewItem *item)
qreal positionAt(int index) const override
void updateFooter() override
qreal endPositionAt(int index) const override
void setPosition(qreal pos) override
QQuickItemViewAttached * getAttachedObject(const QObject *object) const override
void resetFirstItemPosition(qreal pos=0.0) override
bool applyInsertionChange(const QQmlChangeSet::Change &insert, ChangeResult *changeResult, QList< FxViewItem * > *addedItems, QList< MovedItem > *movingIntoView) override
void initializeComponentItem(QQuickItem *item) const override
void adjustFirstItem(qreal forwards, qreal backwards, int changeBeforeVisible) override
qreal rowPosAt(int modelIndex) const
void repositionItemAt(FxViewItem *item, int index, qreal sizeBuffer) override
FxViewItem * snapItemAt(qreal pos) const
void fixup(AxisData &data, qreal minExtent, qreal maxExtent) override
void resetHighlightPosition() override
void changedVisibleIndex(int newIndex) override
void layoutVisibleItems(int fromModelIndex=0) override
qreal contentYForPosition(qreal pos) const
qreal lastPosition() const override
FxViewItem * newViewItem(int index, QQuickItem *item) override
qreal contentXForPosition(qreal pos) const
qreal headerSize() const override
qreal originPosition() const override
void updateHeader() override
bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) override
qreal colPosAt(int modelIndex) const
void initializeCurrentItem() override
QSmoothedAnimation * highlightXAnimator
#define QML_FLICK_SNAPONETHRESHOLD
QT_REQUIRE_CONFIG(quick_gridview)