33 Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged VIRTUAL)
34 Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged VIRTUAL)
35 Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
36 Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
37 Q_PROPERTY(QQuickItem *contentItem READ contentItem CONSTANT)
39 Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
40 Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
41 Q_PROPERTY(qreal originY READ originY NOTIFY originYChanged)
43 Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
44 Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
45 Q_PROPERTY(qreal originX READ originX NOTIFY originXChanged)
47 Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
48 Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
50 Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged)
51 Q_PROPERTY(BoundsMovement boundsMovement READ boundsMovement WRITE setBoundsMovement NOTIFY boundsMovementChanged REVISION(2, 10))
52 Q_PROPERTY(QQuickTransition *rebound READ rebound WRITE setRebound NOTIFY reboundChanged)
53 Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
54 Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
55 Q_PROPERTY(
bool moving READ isMoving NOTIFY movingChanged)
56 Q_PROPERTY(
bool movingHorizontally READ isMovingHorizontally NOTIFY movingHorizontallyChanged)
57 Q_PROPERTY(
bool movingVertically READ isMovingVertically NOTIFY movingVerticallyChanged)
58 Q_PROPERTY(
bool flicking READ isFlicking NOTIFY flickingChanged)
59 Q_PROPERTY(
bool flickingHorizontally READ isFlickingHorizontally NOTIFY flickingHorizontallyChanged)
60 Q_PROPERTY(
bool flickingVertically READ isFlickingVertically NOTIFY flickingVerticallyChanged)
61 Q_PROPERTY(
bool dragging READ isDragging NOTIFY draggingChanged)
62 Q_PROPERTY(
bool draggingHorizontally READ isDraggingHorizontally NOTIFY draggingHorizontallyChanged)
63 Q_PROPERTY(
bool draggingVertically READ isDraggingVertically NOTIFY draggingVerticallyChanged)
64 Q_PROPERTY(FlickableDirection flickableDirection READ flickableDirection WRITE setFlickableDirection NOTIFY flickableDirectionChanged)
66 Q_PROPERTY(
bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
67 Q_PROPERTY(
int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
69 Q_PROPERTY(
bool atXEnd READ isAtXEnd NOTIFY atXEndChanged)
70 Q_PROPERTY(
bool atYEnd READ isAtYEnd NOTIFY atYEndChanged)
71 Q_PROPERTY(
bool atXBeginning READ isAtXBeginning NOTIFY atXBeginningChanged)
72 Q_PROPERTY(
bool atYBeginning READ isAtYBeginning NOTIFY atYBeginningChanged)
74 Q_PROPERTY(QQuickFlickableVisibleArea *visibleArea READ visibleArea CONSTANT)
76 Q_PROPERTY(
bool pixelAligned READ pixelAligned WRITE setPixelAligned NOTIFY pixelAlignedChanged)
77 Q_PROPERTY(
bool synchronousDrag READ synchronousDrag WRITE setSynchronousDrag NOTIFY synchronousDragChanged REVISION(2, 12))
79 Q_PROPERTY(qreal horizontalOvershoot READ horizontalOvershoot NOTIFY horizontalOvershootChanged REVISION(2, 9))
80 Q_PROPERTY(qreal verticalOvershoot READ verticalOvershoot NOTIFY verticalOvershootChanged REVISION(2, 9))
82 Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged REVISION(6, 9) FINAL)
84 Q_PROPERTY(QQmlListProperty<QObject> flickableData READ flickableData)
85 Q_PROPERTY(QQmlListProperty<QQuickItem> flickableChildren READ flickableChildren)
86 Q_CLASSINFO(
"DefaultProperty",
"flickableData")
87 QML_NAMED_ELEMENT(Flickable)
88 QML_ADDED_IN_VERSION(2, 0)
91 QQuickFlickable(QQuickItem *parent=
nullptr);
92 ~QQuickFlickable() override;
94 QQmlListProperty<QObject> flickableData();
95 QQmlListProperty<QQuickItem> flickableChildren();
97 enum BoundsBehaviorFlag {
100 OvershootBounds = 0x2,
101 DragAndOvershootBounds = DragOverBounds | OvershootBounds
103 Q_DECLARE_FLAGS(BoundsBehavior, BoundsBehaviorFlag)
104 Q_FLAG(BoundsBehavior)
106 BoundsBehavior boundsBehavior()
const;
107 void setBoundsBehavior(BoundsBehavior);
109 enum BoundsMovement {
111 FollowBoundsBehavior = 0x1
113 Q_ENUM(BoundsMovement)
115 BoundsMovement boundsMovement()
const;
116 void setBoundsMovement(BoundsMovement movement);
118 QQuickTransition *rebound()
const;
119 void setRebound(QQuickTransition *transition);
121 qreal contentWidth()
const;
122 void setContentWidth(qreal);
124 qreal contentHeight()
const;
125 void setContentHeight(qreal);
127 qreal contentX()
const;
128 virtual void setContentX(qreal pos);
130 qreal contentY()
const;
131 virtual void setContentY(qreal pos);
133 qreal topMargin()
const;
134 void setTopMargin(qreal m);
136 qreal bottomMargin()
const;
137 void setBottomMargin(qreal m);
139 qreal leftMargin()
const;
140 void setLeftMargin(qreal m);
142 qreal rightMargin()
const;
143 void setRightMargin(qreal m);
145 virtual qreal originY()
const;
146 virtual qreal originX()
const;
148 bool isMoving()
const;
149 bool isMovingHorizontally()
const;
150 bool isMovingVertically()
const;
151 bool isFlicking()
const;
152 bool isFlickingHorizontally()
const;
153 bool isFlickingVertically()
const;
154 bool isDragging()
const;
155 bool isDraggingHorizontally()
const;
156 bool isDraggingVertically()
const;
158 int pressDelay()
const;
159 void setPressDelay(
int delay);
161 qreal maximumFlickVelocity()
const;
162 void setMaximumFlickVelocity(qreal);
164 qreal flickDeceleration()
const;
165 void setFlickDeceleration(qreal);
167 bool isInteractive()
const;
168 void setInteractive(
bool);
170 qreal horizontalVelocity()
const;
171 qreal verticalVelocity()
const;
173 bool isAtXEnd()
const;
174 bool isAtXBeginning()
const;
175 bool isAtYEnd()
const;
176 bool isAtYBeginning()
const;
178 QQuickItem *contentItem()
const;
180 enum FlickableDirection { AutoFlickDirection=0x0, HorizontalFlick=0x1, VerticalFlick=0x2, HorizontalAndVerticalFlick=0x3,
181 AutoFlickIfNeeded=0xc };
182 Q_ENUM(FlickableDirection)
183 FlickableDirection flickableDirection()
const;
184 void setFlickableDirection(FlickableDirection);
186 bool pixelAligned()
const;
187 void setPixelAligned(
bool align);
189 bool synchronousDrag()
const;
190 void setSynchronousDrag(
bool v);
192 Qt::MouseButtons acceptedButtons()
const;
193 void setAcceptedButtons(Qt::MouseButtons buttons);
195 qreal horizontalOvershoot()
const;
196 qreal verticalOvershoot()
const;
198 enum PositionModeFlag {
199 AlignLeft = Qt::AlignLeft,
200 AlignRight = Qt::AlignRight,
201 AlignHCenter = Qt::AlignHCenter,
202 AlignTop = Qt::AlignTop,
203 AlignBottom = Qt::AlignBottom,
204 AlignVCenter = Qt::AlignVCenter,
205 AlignCenter = AlignVCenter | AlignHCenter,
209 Q_DECLARE_FLAGS(PositionMode, PositionModeFlag)
212 Q_INVOKABLE
void resizeContent(qreal w, qreal h, QPointF center);
213 Q_INVOKABLE
void returnToBounds();
214 Q_INVOKABLE
void flick(qreal xVelocity, qreal yVelocity);
215 Q_INVOKABLE
void cancelFlick();
216 Q_REVISION(6, 11) Q_INVOKABLE
void positionViewAtChild(QQuickItem *child, PositionMode mode,
const QPointF &offset = QPointF());
217 Q_REVISION(6, 11) Q_INVOKABLE
void flickToChild(QQuickItem *child, PositionMode mode,
const QPointF &offset = QPointF());
218 Q_REVISION(6, 11) Q_INVOKABLE
void flickTo(
const QPointF &position);
221 void contentWidthChanged();
222 void contentHeightChanged();
223 void contentXChanged();
224 void contentYChanged();
225 void topMarginChanged();
226 void bottomMarginChanged();
227 void leftMarginChanged();
228 void rightMarginChanged();
229 void originYChanged();
230 void originXChanged();
231 void movingChanged();
232 void movingHorizontallyChanged();
233 void movingVerticallyChanged();
234 void flickingChanged();
235 void flickingHorizontallyChanged();
236 void flickingVerticallyChanged();
237 void draggingChanged();
238 void draggingHorizontallyChanged();
239 void draggingVerticallyChanged();
240 void horizontalVelocityChanged();
241 void verticalVelocityChanged();
242 void isAtBoundaryChanged();
243 void flickableDirectionChanged();
244 void interactiveChanged();
245 void boundsBehaviorChanged();
246 Q_REVISION(2, 10)
void boundsMovementChanged();
247 void reboundChanged();
248 void maximumFlickVelocityChanged();
249 void flickDecelerationChanged();
250 void pressDelayChanged();
251 void movementStarted();
252 void movementEnded();
257 void pixelAlignedChanged();
258 Q_REVISION(2, 12)
void synchronousDragChanged();
259 Q_REVISION(2, 9)
void horizontalOvershootChanged();
260 Q_REVISION(2, 9)
void verticalOvershootChanged();
263 void atXEndChanged();
264 void atYEndChanged();
265 void atXBeginningChanged();
266 void atYBeginningChanged();
268 Q_REVISION(6, 9)
void acceptedButtonsChanged();
271 bool childMouseEventFilter(QQuickItem *, QEvent *) override;
272 void mousePressEvent(QMouseEvent *event) override;
273 void mouseMoveEvent(QMouseEvent *event) override;
274 void mouseReleaseEvent(QMouseEvent *event) override;
275 void touchEvent(QTouchEvent *event) override;
276#if QT_CONFIG(wheelevent)
277 void wheelEvent(QWheelEvent *event) override;
279 void timerEvent(QTimerEvent *event) override;
281 QQuickFlickableVisibleArea *visibleArea();
284 void movementStarting();
285 void movementEnding();
286 void movementEnding(
bool hMovementEnding,
bool vMovementEnding);
287 void velocityTimelineCompleted();
288 void timelineCompleted();
291 virtual qreal minXExtent()
const;
292 virtual qreal minYExtent()
const;
293 virtual qreal maxXExtent()
const;
294 virtual qreal maxYExtent()
const;
295 qreal vWidth()
const;
296 qreal vHeight()
const;
297 void componentComplete() override;
298 virtual void viewportMoved(Qt::Orientations orient);
299 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
300 void mouseUngrabEvent() override;
301 bool filterPointerEvent(QQuickItem *receiver, QPointerEvent *event);
306 QPointF computePosition(QPointF currentPosition, QRectF itemRect, PositionMode mode,
307 const QPointF &offset = QPointF())
const;
310 QQuickFlickable(QQuickFlickablePrivate &dd, QQuickItem *parent);
313 Q_DISABLE_COPY(QQuickFlickable)
314 Q_DECLARE_PRIVATE(QQuickFlickable)
315 friend class QQuickFlickableVisibleArea;
316 friend class QQuickFlickableReboundTransition;