42 #include "private/qdeclarativeflickable_p.h" 43 #include "private/qdeclarativeflickable_p_p.h" 45 #include <QGraphicsSceneMouseEvent> 48 #include "qplatformdefs.h" 53 #ifndef QML_FLICK_OVERSHOOT 54 #define QML_FLICK_OVERSHOOT 200 58 #ifndef QML_FLICK_SAMPLEBUFFER 59 #define QML_FLICK_SAMPLEBUFFER 3 64 #ifndef QML_FLICK_DISCARDSAMPLES 65 #define QML_FLICK_DISCARDSAMPLES 1 69 #ifndef QML_FLICK_DEFAULTMAXVELOCITY 70 #define QML_FLICK_DEFAULTMAXVELOCITY 2500 74 #ifndef QML_FLICK_DEFAULTDECELERATION 75 #define QML_FLICK_DEFAULTDECELERATION 1750 79 #ifndef QML_FLICK_OVERSHOOTFRICTION 80 #define QML_FLICK_OVERSHOOTFRICTION 8 92 :
QObject(parent), flickable(parent), m_xPosition(0.), m_widthRatio(0.)
93 , m_yPosition(0.), m_heightRatio(0.)
121 bool changeX =
false;
122 bool changeY =
false;
123 bool changeWidth =
false;
124 bool changeHeight =
false;
130 qreal pageSize = viewheight / (maxyextent + viewheight);
145 pageSize = viewwidth / (maxxextent + viewwidth);
171 , hMoved(false), vMoved(false)
172 , stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
175 , delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(400)
176 , fixupMode(Normal), vTime(0), visibleArea(0)
187 static int timelineUpdatedIdx = -1;
188 static int timelineCompletedIdx = -1;
189 static int flickableTickedIdx = -1;
190 static int flickableMovementEndingIdx = -1;
191 if (timelineUpdatedIdx == -1) {
202 q->setFiltersChildEvents(
true);
224 else if (v < -maxVelocity)
226 velocityBuffer.append(v);
228 velocityBuffer.remove(0);
236 for (
int i = 0; i < count; ++i) {
237 qreal v = velocityBuffer.at(i);
248 if (newGeom.
x() != oldGeom.
x())
249 emit q->contentXChanged();
250 if (newGeom.
y() != oldGeom.
y())
251 emit q->contentYChanged();
271 qreal maxDistance = -1;
281 if (maxDistance > 0) {
297 emit q->flickingChanged();
298 emit q->flickingHorizontallyChanged();
300 emit q->flickStarted();
304 emit q->flickingChanged();
305 emit q->flickingVerticallyChanged();
307 emit q->flickStarted();
311 fixup(data, minExtent, maxExtent);
328 fixup(
hData, q->minXExtent(), q->maxXExtent());
334 fixup(
vData, q->minYExtent(), q->maxYExtent());
339 if (data.
move.
value() > minExtent || maxExtent > minExtent) {
360 }
else if (data.
move.
value() < maxExtent) {
388 bool atBoundaryChange =
false;
391 const int maxyextent = int(-q->maxYExtent());
393 bool atBeginning = (ypos <= -q->minYExtent());
394 bool atEnd = (maxyextent <= ypos);
398 atBoundaryChange =
true;
402 atBoundaryChange =
true;
406 const int maxxextent = int(-q->maxXExtent());
408 atBeginning = (xpos <= -q->minXExtent());
409 atEnd = (maxxextent <= xpos);
413 atBoundaryChange =
true;
417 atBoundaryChange =
true;
420 if (atBoundaryChange)
421 emit q->isAtBoundaryChanged();
579 return -
d->contentItem->x();
585 d->timeline.reset(
d->hData.move);
586 d->vTime =
d->timeline.time();
588 if (-pos !=
d->hData.move.value()) {
589 d->hData.move.setValue(-pos);
597 return -
d->contentItem->y();
603 d->timeline.reset(
d->vData.move);
604 d->vTime =
d->timeline.time();
606 if (-pos !=
d->vData.move.value()) {
607 d->vData.move.setValue(-pos);
631 return d->interactive;
637 if (interactive !=
d->interactive) {
639 if (!interactive && (
d->hData.flicking ||
d->vData.flicking)) {
641 d->vTime =
d->timeline.time();
642 d->hData.flicking =
false;
643 d->vData.flicking =
false;
667 return d->hData.smoothVelocity.value();
673 return d->vData.smoothVelocity.value();
691 return d->hData.atEnd;
697 return d->hData.atBeginning;
703 return d->vData.atEnd;
709 return d->vData.atBeginning;
741 return d->contentItem;
749 return d->visibleArea;
773 return d->flickableDirection;
779 if (direction !=
d->flickableDirection) {
793 q->setKeepMouseGrab(stealMouse);
798 hData.dragMinBound = q->minXExtent();
799 vData.dragMinBound = q->minYExtent();
800 hData.dragMaxBound = q->maxXExtent();
801 vData.dragMaxBound = q->maxYExtent();
805 pressPos =
event->pos();
806 hData.pressPos = hData.move.value();
807 vData.pressPos = vData.move.value();
808 hData.flicking =
false;
809 vData.flicking =
false;
819 bool rejectY =
false;
820 bool rejectX =
false;
822 bool stealY = stealMouse;
823 bool stealX = stealMouse;
826 int dy = int(event->
pos().
y() - pressPos.y());
829 vData.dragStartOffset = dy;
830 qreal newY = dy + vData.pressPos - vData.dragStartOffset;
831 const qreal minY = vData.dragMinBound;
832 const qreal maxY = vData.dragMaxBound;
834 newY = minY + (newY - minY) / 2;
835 if (newY < maxY && maxY - minY <= 0)
836 newY = maxY + (newY - maxY) / 2;
839 rejectY = vData.pressPos == maxY && dy < 0;
843 rejectY = vData.pressPos == minY && dy > 0;
845 if (!rejectY && stealMouse && dy != 0) {
846 vData.move.setValue(
qRound(newY));
855 int dx = int(event->
pos().
x() - pressPos.x());
858 hData.dragStartOffset = dx;
859 qreal newX = dx + hData.pressPos - hData.dragStartOffset;
860 const qreal minX = hData.dragMinBound;
861 const qreal maxX = hData.dragMaxBound;
863 newX = minX + (newX - minX) / 2;
864 if (newX < maxX && maxX - minX <= 0)
865 newX = maxX + (newX - maxX) / 2;
868 rejectX = hData.pressPos == maxX && dx < 0;
872 rejectX = hData.pressPos == minX && dx > 0;
874 if (!rejectX && stealMouse && dx != 0) {
875 hData.move.setValue(
qRound(newX));
884 stealMouse = stealX || stealY;
886 q->setKeepMouseGrab(
true);
889 vData.velocityBuffer.clear();
893 hData.velocityBuffer.clear();
897 if (hMoved || vMoved) {
898 q->movementStarting();
902 if (!lastPos.isNull()) {
907 qreal dy =
event->pos().y()-lastPos.y();
908 if (q->yflick() && !rejectY)
909 vData.addVelocitySample(dy/elapsed, maxVelocity);
910 qreal dx =
event->pos().x()-lastPos.x();
911 if (q->xflick() && !rejectX)
912 hData.addVelocitySample(dx/elapsed, maxVelocity);
915 lastPos =
event->pos();
922 q->setKeepMouseGrab(
false);
924 if (!lastPosTime.isValid())
930 vData.updateVelocity();
931 hData.updateVelocity();
932 vTime = timeline.time();
934 qreal velocity = elapsed < 100 ? vData.velocity : 0;
935 if (vData.atBeginning || vData.atEnd)
938 velocityTimeline.reset(vData.smoothVelocity);
939 vData.smoothVelocity.setValue(-velocity);
945 velocity = elapsed < 100 ? hData.velocity : 0;
946 if (hData.atBeginning || hData.atEnd)
949 velocityTimeline.reset(hData.smoothVelocity);
950 hData.smoothVelocity.setValue(-velocity);
956 if (!timeline.isActive())
963 if (
d->interactive) {
965 d->handleMousePressEvent(event);
975 if (
d->interactive) {
976 d->handleMouseMoveEvent(event);
986 if (
d->interactive) {
987 d->clearDelayedPress();
988 d->handleMouseReleaseEvent(event);
999 if (!
d->interactive) {
1004 d->vData.velocity =
qMax(event->
delta()*2 -
d->vData.smoothVelocity.value(),
qreal(
d->maxVelocity/4));
1007 d->vData.velocity =
qMin(event->
delta()*2 -
d->vData.smoothVelocity.value(),
qreal(-
d->maxVelocity/4));
1011 d->vData.flicking =
false;
1012 d->flickY(
d->vData.velocity);
1013 if (
d->vData.flicking) {
1022 d->hData.velocity =
qMax(event->
delta()*2 -
d->hData.smoothVelocity.value(),
qreal(
d->maxVelocity/4));
1025 d->hData.velocity =
qMin(event->
delta()*2 -
d->hData.smoothVelocity.value(),
qreal(-
d->maxVelocity/4));
1029 d->hData.flicking =
false;
1030 d->flickX(
d->hData.velocity);
1031 if (
d->hData.flicking) {
1061 if (!isOutermostPressDelay())
1063 delayedPressTarget = q->scene()->mouseGrabberItem();
1066 for (
int i = 0x1; i <= 0x10; i <<= 1) {
1069 delayedPressEvent->setButtonDownPos(button, event->
buttonDownPos(button));
1074 delayedPressEvent->setButtons(event->
buttons());
1075 delayedPressEvent->setButton(event->
button());
1076 delayedPressEvent->setPos(event->
pos());
1077 delayedPressEvent->setScenePos(event->
scenePos());
1078 delayedPressEvent->setScreenPos(event->
screenPos());
1079 delayedPressEvent->setLastPos(event->
lastPos());
1080 delayedPressEvent->setLastScenePos(event->
lastScenePos());
1081 delayedPressEvent->setLastScreenPos(event->
lastScreenPos());
1082 delayedPressEvent->setModifiers(event->
modifiers());
1088 if (delayedPressEvent) {
1089 delayedPressTimer.stop();
1090 delete delayedPressEvent;
1091 delayedPressEvent = 0;
1108 if (event->
timerId() ==
d->delayedPressTimer.timerId()) {
1109 d->delayedPressTimer.stop();
1110 if (
d->delayedPressEvent) {
1112 if (!grabber || grabber !=
this) {
1116 d->delayedPressTarget->ungrabMouse();
1120 delete d->delayedPressEvent;
1122 d->delayedPressEvent = 0;
1152 qreal prevX =
d->lastFlickablePosition.x();
1153 qreal prevY =
d->lastFlickablePosition.y();
1154 if (
d->pressed ||
d->calcVelocity) {
1158 if (
qAbs(horizontalVelocity) > 0) {
1159 d->velocityTimeline.reset(
d->hData.smoothVelocity);
1160 d->velocityTimeline.move(
d->hData.smoothVelocity, horizontalVelocity,
d->reportedVelocitySmoothing);
1161 d->velocityTimeline.move(
d->hData.smoothVelocity, 0,
d->reportedVelocitySmoothing);
1164 if (
qAbs(verticalVelocity) > 0) {
1165 d->velocityTimeline.reset(
d->vData.smoothVelocity);
1166 d->velocityTimeline.move(
d->vData.smoothVelocity, verticalVelocity,
d->reportedVelocitySmoothing);
1167 d->velocityTimeline.move(
d->vData.smoothVelocity, 0,
d->reportedVelocitySmoothing);
1171 if (
d->timeline.time() >
d->vTime) {
1172 d->velocityTimeline.clear();
1175 d->hData.smoothVelocity.setValue(horizontalVelocity);
1176 d->vData.smoothVelocity.setValue(verticalVelocity);
1180 if (!
d->vData.inOvershoot && !
d->vData.fixingUp &&
d->vData.flicking
1182 &&
qAbs(
d->vData.smoothVelocity.value()) > 100) {
1184 d->vData.inOvershoot =
true;
1186 d->timeline.reset(
d->vData.move);
1190 if (!
d->hData.inOvershoot && !
d->hData.fixingUp &&
d->hData.flicking
1192 &&
qAbs(
d->hData.smoothVelocity.value()) > 100) {
1194 d->hData.inOvershoot =
true;
1195 qreal maxDistance =
d->overShootDistance(
width());
1196 d->timeline.reset(
d->hData.move);
1201 d->lastFlickablePosition =
QPointF(
d->hData.move.value(),
d->vData.move.value());
1203 d->vTime =
d->timeline.time();
1204 d->updateBeginningEnd();
1208 const QRectF &oldGeometry)
1213 bool changed =
false;
1214 if (newGeometry.
width() != oldGeometry.
width()) {
1217 if (
d->hData.viewSize < 0) {
1218 d->contentItem->setWidth(
width());
1222 if (!
d->pressed && !
d->hData.moving && !
d->vData.moving) {
1230 if (
d->vData.viewSize < 0) {
1231 d->contentItem->setHeight(
height());
1235 if (!
d->pressed && !
d->hData.moving && !
d->vData.moving) {
1242 d->updateBeginningEnd();
1248 d->timeline.reset(
d->hData.move);
1249 d->timeline.reset(
d->vData.move);
1259 i->
setParentItem(static_cast<QDeclarativeFlickablePrivate*>(prop->
data)->contentItem);
1283 if (index < childItemCount) {
1286 return contentItem->
children().
at(index - childItemCount);
1297 for (
int i = 0; i < graphicsItems.
count(); i++)
1301 for (
int i = 0; i < objects.
count(); i++)
1347 return d->boundsBehavior;
1353 if (b ==
d->boundsBehavior)
1355 d->boundsBehavior = b;
1382 return d->hData.viewSize;
1388 if (
d->hData.viewSize == w)
1390 d->hData.viewSize = w;
1392 d->contentItem->setWidth(
width());
1394 d->contentItem->setWidth(w);
1396 if (!
d->pressed && !
d->hData.moving && !
d->vData.moving) {
1399 }
else if (!
d->pressed &&
d->hData.fixingUp) {
1404 d->updateBeginningEnd();
1410 return d->vData.viewSize;
1416 if (
d->vData.viewSize == h)
1418 d->vData.viewSize = h;
1420 d->contentItem->setHeight(
height());
1422 d->contentItem->setHeight(h);
1424 if (!
d->pressed && !
d->hData.moving && !
d->vData.moving) {
1427 }
else if (!
d->pressed &&
d->vData.fixingUp) {
1432 d->updateBeginningEnd();
1455 if (w !=
d->hData.viewSize) {
1456 qreal oldSize =
d->hData.viewSize;
1457 d->hData.viewSize = w;
1458 d->contentItem->setWidth(w);
1460 if (center.
x() != 0) {
1465 if (h !=
d->vData.viewSize) {
1466 qreal oldSize =
d->vData.viewSize;
1467 d->vData.viewSize = h;
1468 d->contentItem->setHeight(h);
1470 if (center.
y() != 0) {
1475 d->updateBeginningEnd();
1501 if (
d->hData.viewSize < 0)
1504 return d->hData.viewSize;
1510 if (
d->vData.viewSize < 0)
1513 return d->vData.viewSize;
1541 d->stealMouse =
false;
1557 bool disabledItem = grabberItem && !grabberItem->
isEnabled();
1558 bool stealThisEvent =
d->stealMouse;
1561 for (
int i = 0x1; i <= 0x10; i <<= 1) {
1581 d->captureDelayedPress(event);
1582 stealThisEvent =
d->stealMouse;
1585 if (
d->delayedPressEvent) {
1589 d->delayedPressTarget->ungrabMouse();
1592 d->clearDelayedPress();
1596 d->stealMouse =
false;
1606 if ((grabber && stealThisEvent && !grabber->
keepMouseGrab() && grabber !=
this) || disabledItem) {
1607 d->clearDelayedPress();
1611 return stealThisEvent ||
d->delayedPressEvent || disabledItem;
1612 }
else if (
d->lastPosTime.isValid()) {
1613 d->lastPosTime.invalidate();
1616 d->clearDelayedPress();
1617 d->stealMouse =
false;
1629 switch (e->
type()) {
1633 return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
1653 return d->maxVelocity;
1659 if (v ==
d->maxVelocity)
1677 return d->deceleration;
1683 if (deceleration ==
d->deceleration)
1685 d->deceleration = deceleration;
1692 return d->hData.flicking ||
d->vData.flicking;
1709 return d->hData.flicking;
1715 return d->vData.flicking;
1738 return d->pressDelay;
1744 if (
d->pressDelay == delay)
1746 d->pressDelay = delay;
1754 return d->hData.moving ||
d->vData.moving;
1772 return d->hData.moving;
1778 return d->vData.moving;
1784 if (
d->hMoved && !
d->hData.moving) {
1785 d->hData.moving =
true;
1788 if (!
d->vData.moving)
1791 else if (
d->vMoved && !
d->vData.moving) {
1792 d->vData.moving =
true;
1795 if (!
d->hData.moving)
1805 d->hData.smoothVelocity.setValue(0);
1806 d->vData.smoothVelocity.setValue(0);
1812 if (
d->hData.flicking) {
1813 d->hData.flicking =
false;
1816 if (!
d->vData.flicking)
1819 if (!
d->pressed && !
d->stealMouse) {
1820 if (
d->hData.moving) {
1821 d->hData.moving =
false;
1825 if (!
d->vData.moving)
1829 d->hData.fixingUp =
false;
1835 if (
d->vData.flicking) {
1836 d->vData.flicking =
false;
1839 if (!
d->hData.flicking)
1842 if (!
d->pressed && !
d->stealMouse) {
1843 if (
d->vData.moving) {
1844 d->vData.moving =
false;
1848 if (!
d->hData.moving)
1852 d->vData.fixingUp =
false;
1858 emit q->horizontalVelocityChanged();
1859 emit q->verticalVelocityChanged();
void setFlickableDirection(FlickableDirection)
void flickY(qreal velocity)
qreal heightRatio() const
bool isAtYBeginning() const
void movingVerticallyChanged()
static QObject * data_at(QDeclarativeListProperty< QObject > *, int)
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant, const QVariant *thisPointerVariant)
Make sure not to trigger any pure virtual function calls (e.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object...
BoundsBehavior boundsBehavior() const
QPoint screenPos() const
Returns the mouse cursor position in screen coordinates.
static const int RetainGrabVelocity
QDeclarativeItem * contentItem
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static double elapsed(qint64 after, qint64 before)
#define QT_END_NAMESPACE
This macro expands to.
void boundsBehaviorChanged()
static qint64 elapsed(QElapsedTimer &)
void xPositionChanged(qreal xPosition)
QDeclarativeParserStatus ** d
QList< QGraphicsItem * > childItems() const
Returns a list of this item's children.
virtual qreal maxYExtent() const
The QEasingCurve class provides easing curves for controlling animation.
int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel)
Decelerate timeLineValue from the starting velocity to zero at the given acceleration rate...
bool sceneEvent(QEvent *event)
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
void setMaximumFlickVelocity(qreal)
#define QML_FLICK_OVERSHOOTFRICTION
void flickingHorizontallyChanged()
virtual bool event(QEvent *)
void flickingVerticallyChanged()
friend class QDeclarativeFlickableVisibleArea
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
void setAccepted(bool accepted)
static void fixupY_callback(void *)
void move(QDeclarativeTimeLineValue &, qreal destination, int time=500)
Linearly change the timeLineValue from its current value to the given destination value over time mil...
The QPointF class defines a point in the plane using floating point precision.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
QDeclarativeFlickable(QDeclarativeItem *parent=0)
QDeclarativeItem * contentItem()
Qt::MouseButton button() const
Returns the mouse button (if any) that caused the event.
void handleMousePressEvent(QGraphicsSceneMouseEvent *)
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
void captureDelayedPress(QGraphicsSceneMouseEvent *event)
void setBoundsBehavior(BoundsBehavior)
QPointF pos() const
Returns the position of the item in parent coordinates.
void reset(QDeclarativeTimeLineValue &)
Cancel (but don't complete) all scheduled actions for timeLineValue.
int count(const T &t) const
Returns the number of occurrences of value in the list.
qreal flickDeceleration() const
QDeclarativeListProperty< QObject > flickableData()
#define QML_FLICK_SAMPLEBUFFER
QDeclarativeListProperty< QGraphicsObject > flickableChildren()
T * qobject_cast(QObject *object)
bool isMovingVertically() const
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse...
bool isEnabled() const
Returns true if the item is enabled; otherwise, false is returned.
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
This event handler, for event event, can be reimplemented to receive wheel events for this item...
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
void flickDecelerationChanged()
void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &)
virtual qreal minYExtent() const
void yPositionChanged(qreal yPosition)
bool isFlickingHorizontally() const
void contentHeightChanged()
bool sendEvent(QGraphicsItem *item, QEvent *event)
Sends event event to item item through possible event filters.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void setRoundedViewportX(qreal x)
qreal x() const
Returns the x-coordinate of this point.
void setParent(QObject *)
Makes the object a child of parent.
Q_INVOKABLE void resizeContent(qreal w, qreal h, QPointF center)
QPointF buttonDownScenePos(Qt::MouseButton button) const
Returns the mouse cursor position in scene coordinates where the specified button was clicked...
QGraphicsObject * toGraphicsObject()
Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object...
void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
void setParentItem(QDeclarativeItem *parent)
void setFlickDeceleration(qreal)
qreal overShootDistance(qreal size)
QPointF lastScenePos() const
Returns the last recorded mouse cursor position in scene coordinates.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
const qreal MinimumFlickVelocity
The QDeclarativeItem class provides the most basic of all visual items in QML.
void flickX(qreal velocity)
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
bool sendMouseEvent(QGraphicsSceneMouseEvent *event)
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
#define QML_FLICK_DISCARDSAMPLES
qreal height() const
Returns the height of the rectangle.
virtual qreal value() const
Return the current value.
virtual void viewportMoved()
#define QML_FLICK_OVERSHOOT
const T & at(int i) const
Returns the item at index position i in the list.
bool spontaneous() const
Returns true if the event originated outside the application (a system event); otherwise returns fals...
void flickableDirectionChanged()
QDeclarativeTimeLine timeline
QDeclarativeFlickableVisibleArea * visibleArea()
void updateBeginningEnd()
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
QDeclarativeFlickablePrivate()
void handleMouseMoveEvent(QGraphicsSceneMouseEvent *)
qreal width() const
Returns the width of the rectangle.
bool isMovingHorizontally() const
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
void invalidate()
Marks this QElapsedTimer object as invalid.
static void data_append(QDeclarativeListProperty< QObject > *, QObject *)
static int startDragDistance()
void setX(qreal x)
Set's the x coordinate of the item's position.
void interactiveChanged()
void setContentHeight(qreal)
virtual qreal minXExtent() const
static int data_count(QDeclarativeListProperty< QObject > *)
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item's changes in geometry from oldGeometry to newGeometry...
void set(QDeclarativeTimeLineValue &, qreal)
Set the value of timeLineValue.
void widthRatioChanged(qreal widthRatio)
QElapsedTimer lastPosTime
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate sy...
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
QDeclarativeFlickableVisibleArea(QDeclarativeFlickable *parent=0)
void setPressDelay(int delay)
bool isFlickingVertically() const
void setContentWidth(qreal)
void addVelocitySample(qreal v, qreal maxVelocity)
static void start(QElapsedTimer &)
void contentWidthChanged()
void setRoundedViewportY(qreal y)
int delta() const
Returns the distance that the wheel is rotated, in eighths (1/8s) of a degree.
QDeclarativeTimeLineValueProxy< QDeclarativeFlickablePrivate > move
QDeclarativeListProperty< QGraphicsObject > childrenList()
Returns a list of this item's children.
qreal y() const
This convenience function is equivalent to calling pos().
bool isOutermostPressDelay() const
#define QML_FLICK_DEFAULTDECELERATION
bool isInteractive() const
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
The QTimerEvent class contains parameters that describe a timer event.
QPoint lastScreenPos() const
Returns the last recorded mouse cursor position in screen coordinates.
QPointF scenePos() const
Returns the mouse cursor position in scene coordinates.
static qint64 restart(QElapsedTimer &)
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QObject * parent() const
Returns a pointer to the parent object.
qreal contentHeight() const
qreal x() const
This convenience function is equivalent to calling pos().
void setY(qreal y)
Set's the y coordinate of the item's position.
static const int FlickThreshold
virtual void componentComplete()
The QPoint class defines a point in the plane using integer precision.
void wheelEvent(QGraphicsSceneWheelEvent *event)
This event handler, for event event, can be reimplemented to receive wheel events for this item...
QPoint buttonDownScreenPos(Qt::MouseButton button) const
Returns the mouse cursor position in screen coordinates where the specified button was clicked...
const QObjectList & children() const
Returns a list of child objects.
qreal contentWidth() const
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
virtual bool sceneEvent(QEvent *)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
FlickableDirection flickableDirection() const
qreal y() const
Returns the y-coordinate of this point.
static void fixupX_callback(void *)
QVariant property(const char *name) const
Returns the value of the object's name property.
bool keepMouseGrab() const
Returns a value indicating whether mouse input should remain with this item exclusively.
QPointF pos() const
Returns the mouse cursor position in item coordinates.
QPointF buttonDownPos(Qt::MouseButton button) const
Returns the mouse cursor position in item coordinates where the specified button was clicked...
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifiers in use at the time the event was sent.
qreal verticalVelocity() const
QDeclarativeFlickableVisibleArea * visibleArea
static void data_clear(QDeclarativeListProperty< QObject > *)
void heightRatioChanged(qreal heightRatio)
qreal horizontalVelocity() const
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void setInteractive(bool)
void ungrabMouse()
Releases the mouse grab.
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
void movingHorizontallyChanged()
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item's changes in geometry from oldGeometry to newGeometry...
virtual void setContentX(qreal pos)
Q_INVOKABLE void returnToBounds()
Qt::Orientation orientation() const
Returns the wheel orientation.
The QGraphicsObject class provides a base class for all graphics items that require signals...
virtual qreal maxXExtent() const
The QEvent class is the base class of all event classes.
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Filters events for the item watched.
Type type() const
Returns the event type.
void maximumFlickVelocityChanged()
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system...
#define QML_FLICK_DEFAULTMAXVELOCITY
void callback(const QDeclarativeTimeLineCallback &)
Execute the event.
qreal maximumFlickVelocity() const
QDeclarativeListProperty< QObject > data()
virtual void setContentY(qreal pos)
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
virtual bool sceneEventFilter(QGraphicsItem *, QEvent *)
Filters events for the item watched.
QDeclarativeFlickable * flickable
Q_DECL_CONSTEXPR int qRound(qreal d)
void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *)
QPointF lastPos() const
Returns the last recorded mouse cursor position in item coordinates.
void grabMouse()
Grabs the mouse input.
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent...
bool isAtXBeginning() const
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.
The QList class is a template class that provides lists.
Qt::LayoutDirection direction
QDeclarativeFlickable::BoundsBehavior boundsBehavior