31 Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
32 Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
33 Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
34 Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
35 Q_PROPERTY(QQuickItem *contentItem READ contentItem CONSTANT)
37 Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
38 Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
39 Q_PROPERTY(qreal originY READ originY NOTIFY originYChanged)
41 Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
42 Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
43 Q_PROPERTY(qreal originX READ originX NOTIFY originXChanged)
45 Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
46 Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
48 Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged)
49 Q_PROPERTY(BoundsMovement boundsMovement READ boundsMovement WRITE setBoundsMovement NOTIFY boundsMovementChanged REVISION(2, 10))
50 Q_PROPERTY(QQuickTransition *rebound READ rebound WRITE setRebound NOTIFY reboundChanged)
51 Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
52 Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
53 Q_PROPERTY(
bool moving READ isMoving NOTIFY movingChanged)
54 Q_PROPERTY(
bool movingHorizontally READ isMovingHorizontally NOTIFY movingHorizontallyChanged)
55 Q_PROPERTY(
bool movingVertically READ isMovingVertically NOTIFY movingVerticallyChanged)
56 Q_PROPERTY(
bool flicking READ isFlicking NOTIFY flickingChanged)
57 Q_PROPERTY(
bool flickingHorizontally READ isFlickingHorizontally NOTIFY flickingHorizontallyChanged)
58 Q_PROPERTY(
bool flickingVertically READ isFlickingVertically NOTIFY flickingVerticallyChanged)
59 Q_PROPERTY(
bool dragging READ isDragging NOTIFY draggingChanged)
60 Q_PROPERTY(
bool draggingHorizontally READ isDraggingHorizontally NOTIFY draggingHorizontallyChanged)
61 Q_PROPERTY(
bool draggingVertically READ isDraggingVertically NOTIFY draggingVerticallyChanged)
62 Q_PROPERTY(FlickableDirection flickableDirection READ flickableDirection WRITE setFlickableDirection NOTIFY flickableDirectionChanged)
64 Q_PROPERTY(
bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
65 Q_PROPERTY(
int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
67 Q_PROPERTY(
bool atXEnd READ isAtXEnd NOTIFY atXEndChanged)
68 Q_PROPERTY(
bool atYEnd READ isAtYEnd NOTIFY atYEndChanged)
69 Q_PROPERTY(
bool atXBeginning READ isAtXBeginning NOTIFY atXBeginningChanged)
70 Q_PROPERTY(
bool atYBeginning READ isAtYBeginning NOTIFY atYBeginningChanged)
72 Q_PROPERTY(QQuickFlickableVisibleArea *visibleArea READ visibleArea CONSTANT)
74 Q_PROPERTY(
bool pixelAligned READ pixelAligned WRITE setPixelAligned NOTIFY pixelAlignedChanged)
75 Q_PROPERTY(
bool synchronousDrag READ synchronousDrag WRITE setSynchronousDrag NOTIFY synchronousDragChanged REVISION(2, 12))
77 Q_PROPERTY(qreal horizontalOvershoot READ horizontalOvershoot NOTIFY horizontalOvershootChanged REVISION(2, 9))
78 Q_PROPERTY(qreal verticalOvershoot READ verticalOvershoot NOTIFY verticalOvershootChanged REVISION(2, 9))
80 Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged REVISION(6, 9) FINAL)
82 Q_PROPERTY(QQmlListProperty<QObject> flickableData READ flickableData)
83 Q_PROPERTY(QQmlListProperty<QQuickItem> flickableChildren READ flickableChildren)
84 Q_CLASSINFO(
"DefaultProperty",
"flickableData")
85 QML_NAMED_ELEMENT(Flickable)
86 QML_ADDED_IN_VERSION(2, 0)
89 QQuickFlickable(QQuickItem *parent=
nullptr);
90 ~QQuickFlickable() override;
92 QQmlListProperty<QObject> flickableData();
93 QQmlListProperty<QQuickItem> flickableChildren();
95 enum BoundsBehaviorFlag {
98 OvershootBounds = 0x2,
99 DragAndOvershootBounds = DragOverBounds | OvershootBounds
101 Q_DECLARE_FLAGS(BoundsBehavior, BoundsBehaviorFlag)
102 Q_FLAG(BoundsBehavior)
104 BoundsBehavior boundsBehavior()
const;
105 void setBoundsBehavior(BoundsBehavior);
107 enum BoundsMovement {
109 FollowBoundsBehavior = 0x1
111 Q_ENUM(BoundsMovement)
113 BoundsMovement boundsMovement()
const;
114 void setBoundsMovement(BoundsMovement movement);
116 QQuickTransition *rebound()
const;
117 void setRebound(QQuickTransition *transition);
119 qreal contentWidth()
const;
120 void setContentWidth(qreal);
122 qreal contentHeight()
const;
123 void setContentHeight(qreal);
125 qreal contentX()
const;
126 virtual void setContentX(qreal pos);
128 qreal contentY()
const;
129 virtual void setContentY(qreal pos);
131 qreal topMargin()
const;
132 void setTopMargin(qreal m);
134 qreal bottomMargin()
const;
135 void setBottomMargin(qreal m);
137 qreal leftMargin()
const;
138 void setLeftMargin(qreal m);
140 qreal rightMargin()
const;
141 void setRightMargin(qreal m);
143 virtual qreal originY()
const;
144 virtual qreal originX()
const;
146 bool isMoving()
const;
147 bool isMovingHorizontally()
const;
148 bool isMovingVertically()
const;
149 bool isFlicking()
const;
150 bool isFlickingHorizontally()
const;
151 bool isFlickingVertically()
const;
152 bool isDragging()
const;
153 bool isDraggingHorizontally()
const;
154 bool isDraggingVertically()
const;
156 int pressDelay()
const;
157 void setPressDelay(
int delay);
159 qreal maximumFlickVelocity()
const;
160 void setMaximumFlickVelocity(qreal);
162 qreal flickDeceleration()
const;
163 void setFlickDeceleration(qreal);
165 bool isInteractive()
const;
166 void setInteractive(
bool);
168 qreal horizontalVelocity()
const;
169 qreal verticalVelocity()
const;
171 bool isAtXEnd()
const;
172 bool isAtXBeginning()
const;
173 bool isAtYEnd()
const;
174 bool isAtYBeginning()
const;
176 QQuickItem *contentItem()
const;
178 enum FlickableDirection { AutoFlickDirection=0x0, HorizontalFlick=0x1, VerticalFlick=0x2, HorizontalAndVerticalFlick=0x3,
179 AutoFlickIfNeeded=0xc };
180 Q_ENUM(FlickableDirection)
181 FlickableDirection flickableDirection()
const;
182 void setFlickableDirection(FlickableDirection);
184 bool pixelAligned()
const;
185 void setPixelAligned(
bool align);
187 bool synchronousDrag()
const;
188 void setSynchronousDrag(
bool v);
190 Qt::MouseButtons acceptedButtons()
const;
191 void setAcceptedButtons(Qt::MouseButtons buttons);
193 qreal horizontalOvershoot()
const;
194 qreal verticalOvershoot()
const;
196 Q_INVOKABLE
void resizeContent(qreal w, qreal h, QPointF center);
197 Q_INVOKABLE
void returnToBounds();
198 Q_INVOKABLE
void flick(qreal xVelocity, qreal yVelocity);
199 Q_INVOKABLE
void cancelFlick();
202 void contentWidthChanged();
203 void contentHeightChanged();
204 void contentXChanged();
205 void contentYChanged();
206 void topMarginChanged();
207 void bottomMarginChanged();
208 void leftMarginChanged();
209 void rightMarginChanged();
210 void originYChanged();
211 void originXChanged();
212 void movingChanged();
213 void movingHorizontallyChanged();
214 void movingVerticallyChanged();
215 void flickingChanged();
216 void flickingHorizontallyChanged();
217 void flickingVerticallyChanged();
218 void draggingChanged();
219 void draggingHorizontallyChanged();
220 void draggingVerticallyChanged();
221 void horizontalVelocityChanged();
222 void verticalVelocityChanged();
223 void isAtBoundaryChanged();
224 void flickableDirectionChanged();
225 void interactiveChanged();
226 void boundsBehaviorChanged();
227 Q_REVISION(2, 10)
void boundsMovementChanged();
228 void reboundChanged();
229 void maximumFlickVelocityChanged();
230 void flickDecelerationChanged();
231 void pressDelayChanged();
232 void movementStarted();
233 void movementEnded();
238 void pixelAlignedChanged();
239 Q_REVISION(2, 12)
void synchronousDragChanged();
240 Q_REVISION(2, 9)
void horizontalOvershootChanged();
241 Q_REVISION(2, 9)
void verticalOvershootChanged();
244 void atXEndChanged();
245 void atYEndChanged();
246 void atXBeginningChanged();
247 void atYBeginningChanged();
249 Q_REVISION(6, 9)
void acceptedButtonsChanged();
252 bool childMouseEventFilter(QQuickItem *, QEvent *) override;
253 void mousePressEvent(QMouseEvent *event) override;
254 void mouseMoveEvent(QMouseEvent *event) override;
255 void mouseReleaseEvent(QMouseEvent *event) override;
256 void touchEvent(QTouchEvent *event) override;
257#if QT_CONFIG(wheelevent)
258 void wheelEvent(QWheelEvent *event) override;
260 void timerEvent(QTimerEvent *event) override;
262 QQuickFlickableVisibleArea *visibleArea();
265 void movementStarting();
266 void movementEnding();
267 void movementEnding(
bool hMovementEnding,
bool vMovementEnding);
268 void velocityTimelineCompleted();
269 void timelineCompleted();
272 virtual qreal minXExtent()
const;
273 virtual qreal minYExtent()
const;
274 virtual qreal maxXExtent()
const;
275 virtual qreal maxYExtent()
const;
276 qreal vWidth()
const;
277 qreal vHeight()
const;
278 void componentComplete() override;
279 virtual void viewportMoved(Qt::Orientations orient);
280 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
281 void mouseUngrabEvent() override;
282 bool filterPointerEvent(QQuickItem *receiver, QPointerEvent *event);
288 QQuickFlickable(QQuickFlickablePrivate &dd, QQuickItem *parent);
291 Q_DISABLE_COPY(QQuickFlickable)
292 Q_DECLARE_PRIVATE(QQuickFlickable)
293 friend class QQuickFlickableVisibleArea;
294 friend class QQuickFlickableReboundTransition;