Qt 4.8
Classes | Public Types | Public Functions | Static Public Functions | Public Variables | List of all members
QDeclarativeFlickablePrivate Class Reference

#include <qdeclarativeflickable_p_p.h>

Inheritance diagram for QDeclarativeFlickablePrivate:
QDeclarativeItemPrivate QDeclarativeItemChangeListener QGraphicsItemPrivate QDeclarativeGridViewPrivate QDeclarativeListViewPrivate

Classes

struct  AxisData
 
struct  Velocity
 

Public Types

enum  FixupMode { Normal, Immediate, ExtentChanged }
 
- Public Types inherited from QDeclarativeItemPrivate
enum  ChangeType {
  Geometry = 0x01, SiblingOrder = 0x02, Visibility = 0x04, Opacity = 0x08,
  Destroyed = 0x10
}
 
- Public Types inherited from QGraphicsItemPrivate
enum  AncestorFlag {
  NoFlag = 0, AncestorHandlesChildEvents = 0x1, AncestorClipsChildren = 0x2, AncestorIgnoresTransformations = 0x4,
  AncestorFiltersChildEvents = 0x8
}
 
enum  Extra {
  ExtraToolTip, ExtraCursor, ExtraCacheData, ExtraMaxDeviceCoordCacheSize,
  ExtraBoundingRegionGranularity
}
 
enum  InvalidateReason { OpacityChanged }
 

Public Functions

void captureDelayedPress (QGraphicsSceneMouseEvent *event)
 
void clearDelayedPress ()
 
virtual void fixup (AxisData &data, qreal minExtent, qreal maxExtent)
 
void fixupX ()
 
void fixupY ()
 
virtual void flick (AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
 
void flickX (qreal velocity)
 
void flickY (qreal velocity)
 
void handleMouseMoveEvent (QGraphicsSceneMouseEvent *)
 
void handleMousePressEvent (QGraphicsSceneMouseEvent *)
 
void handleMouseReleaseEvent (QGraphicsSceneMouseEvent *)
 
void init ()
 
bool isOutermostPressDelay () const
 
void itemGeometryChanged (QDeclarativeItem *, const QRectF &, const QRectF &)
 
qreal overShootDistance (qreal size)
 
 QDeclarativeFlickablePrivate ()
 
void setRoundedViewportX (qreal x)
 
void setRoundedViewportY (qreal y)
 
void updateBeginningEnd ()
 
void updateVelocity ()
 
- Public Functions inherited from QDeclarativeItemPrivate
QDeclarativeStateGroup_states ()
 
void addItemChangeListener (QDeclarativeItemChangeListener *listener, ChangeTypes types)
 
AnchorLinesanchorLines () const
 
QDeclarativeAnchorsanchors ()
 
QDeclarativeAnchorLine baseline () const
 
QDeclarativeAnchorLine bottom () const
 
QPointF computeTransformOrigin () const
 
QDeclarativeListProperty< QObjectdata ()
 
virtual void focusChanged (bool)
 
virtual void focusScopeItemChange (bool isSubFocusItem)
 Subclasses can reimplement this function to be notified when an item becomes a focusScopeItem (or is no longer a focusScopeItem). More...
 
qreal height () const
 
QDeclarativeAnchorLine horizontalCenter () const
 
virtual qreal implicitHeight () const
 
virtual void implicitHeightChanged ()
 
virtual qreal implicitWidth () const
 
virtual void implicitWidthChanged ()
 
void init (QDeclarativeItem *parent)
 
bool isMirrored () const
 
QDeclarativeAnchorLine left () const
 
virtual void mirrorChange ()
 
 QDeclarativeItemPrivate ()
 
void removeItemChangeListener (QDeclarativeItemChangeListener *, ChangeTypes types)
 
void resetHeight ()
 
void resetWidth ()
 
void resolveLayoutMirror ()
 
QDeclarativeListProperty< QObjectresources ()
 
QDeclarativeAnchorLine right () const
 
void setHeight (qreal)
 
void setImplicitLayoutMirror (bool mirror, bool inherit)
 
void setLayoutMirror (bool mirror)
 
virtual void setPosHelper (const QPointF &pos)
 Sets the position pos. More...
 
void setState (const QString &)
 
void setWidth (qreal)
 
virtual void siblingOrderChange ()
 Subclasses can reimplement this function to be notified when its siblingIndex order is changed. More...
 
QString state () const
 
QDeclarativeListProperty< QDeclarativeStatestates ()
 
QDeclarativeAnchorLine top () const
 
virtual void transformChanged ()
 
QDeclarativeListProperty< QDeclarativeTransitiontransitions ()
 
QDeclarativeAnchorLine verticalCenter () const
 
qreal width () const
 
- Public Functions inherited from QGraphicsItemPrivate
void addChild (QGraphicsItem *child)
 QGraphicsScenePrivate::registerTopLevelItem(). More...
 
void appendGraphicsTransform (QGraphicsTransform *t)
 
qreal calcEffectiveOpacity () const
 
void childrenBoundingRectHelper (QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
 Returns the bounding rect of this item's children (excluding itself). More...
 
bool childrenClippedToShape () const
 
bool childrenCombineOpacity () const
 
QDeclarativeListProperty< QGraphicsObjectchildrenList ()
 Returns a list of this item's children. More...
 
void clearFocusHelper (bool giveFocusToParent)
 
void clearSubFocus (QGraphicsItem *rootItem=0, QGraphicsItem *stopItem=0)
 
qreal combineOpacityFromParent (qreal parentOpacity) const
 
void combineTransformFromParent (QTransform *x, const QTransform *viewTransform=0) const
 Combines this item's position and transform onto transform. More...
 
void combineTransformToParent (QTransform *x, const QTransform *viewTransform=0) const
 Combines this item's position and transform onto transform. More...
 
int depth () const
 
bool discardUpdateRequest (bool ignoreVisibleBit=false, bool ignoreDirtyBit=false, bool ignoreOpacity=false) const
 Returns true if we can discard an update request; otherwise false. More...
 
QRectF effectiveBoundingRect (QGraphicsItem *topMostEffectItem=0) const
 Returns the effective bounding rect of the item. More...
 
QRectF effectiveBoundingRect (const QRectF &rect) const
 Returns the effective bounding rect of the given item space rect. More...
 
qreal effectiveOpacity () const
 
void ensureSceneTransform ()
 
void ensureSceneTransformRecursive (QGraphicsItem **topMostDirtyItem)
 
void ensureSequentialSiblingIndex ()
 Ensures that the list of children is sorted by insertion order, and that the siblingIndexes are packed (no gaps), and start at 0. More...
 
void ensureSortedChildren ()
 
QVariant extra (Extra type) const
 
QGraphicsItemCacheextraItemCache () const
 
QPointF genericMapFromScene (const QPointF &pos, const QWidget *viewport) const
 Maps the point pos from scene to item coordinates. More...
 
bool hasTranslateOnlySceneTransform ()
 
void initStyleOption (QStyleOptionGraphicsItem *option, const QTransform &worldTransform, const QRegion &exposedRegion, bool allItems=false) const
 
virtual QVariant inputMethodQueryHelper (Qt::InputMethodQuery query) const
 This helper function helped us add input method query support in Qt 4. More...
 
void invalidateChildGraphicsEffectsRecursively (InvalidateReason reason)
 
void invalidateChildrenSceneTransform ()
 
void invalidateDepthRecursively ()
 
void invalidateParentGraphicsEffectsRecursively ()
 
bool isFullyTransparent () const
 
bool isInvisible () const
 
bool isOpacityNull () const
 
virtual bool isProxyWidget () const
 
bool itemIsUntransformable () const
 
void markParentDirty (bool updateBoundingRect=false)
 
QGraphicsItemCachemaybeExtraItemCache () const
 
void prependGraphicsTransform (QGraphicsTransform *t)
 
 QGraphicsItemPrivate ()
 
void remapItemPos (QEvent *event, QGraphicsItem *item)
 Maps any item pos properties of event to item's coordinate system. More...
 
void removeChild (QGraphicsItem *child)
 QGraphicsScenePrivate::unregisterTopLevelItem(). More...
 
void removeExtraItemCache ()
 
void resetFocusProxy ()
 Sets the focusProxy pointer to 0 for all items that have this item as their focusProxy. More...
 
void resolveDepth ()
 Resolves the stacking depth of this object and all its ancestors. More...
 
virtual void resolveFont (uint inheritedMask)
 
virtual void resolvePalette (uint inheritedMask)
 
QRectF sceneEffectiveBoundingRect () const
 Returns the effective bounding rect of this item in scene coordinates, by combining sceneTransform() with boundingRect(), taking into account the effect that the item might have. More...
 
void sendScenePosChange ()
 
void setEnabledHelper (bool newEnabled, bool explicitly, bool update=true)
 Sets this item's visibility to newEnabled. More...
 
void setExtra (Extra type, const QVariant &value)
 
void setFocusHelper (Qt::FocusReason focusReason, bool climb, bool focusFromHide)
 
void setIsMemberOfGroup (bool enabled)
 Propagates item group membership. More...
 
void setParentItemHelper (QGraphicsItem *parent, const QVariant *newParentVariant, const QVariant *thisPointerVariant)
 Make sure not to trigger any pure virtual function calls (e. More...
 
void setSubFocus (QGraphicsItem *rootItem=0, QGraphicsItem *stopItem=0)
 
void setTransformHelper (const QTransform &transform)
 Sets the transform transform. More...
 
void setVisibleHelper (bool newVisible, bool explicitly, bool update=true)
 Sets this item's visibility to newVisible. More...
 
virtual void subFocusItemChange ()
 Subclasses can reimplement this function to be notified when subFocusItem changes. More...
 
QTransform transformToParent () const
 
void unsetExtra (Extra type)
 
void updateAncestorFlag (QGraphicsItem::GraphicsItemFlag childFlag, AncestorFlag flag=NoFlag, bool enabled=false, bool root=true)
 Propagates the ancestor flag flag with value enabled to all this item's children. More...
 
void updateAncestorFlags ()
 
void updateChildWithGraphicsEffectFlagRecursively ()
 
void updatePaintedViewBoundingRects (bool updateChildren)
 
virtual void updateSceneTransformFromParent ()
 
virtual ~QGraphicsItemPrivate ()
 
- Public Functions inherited from QDeclarativeItemChangeListener
virtual QDeclarativeAnchorsPrivateanchorPrivate ()
 
virtual void itemDestroyed (QDeclarativeItem *)
 
virtual void itemOpacityChanged (QDeclarativeItem *)
 
virtual void itemSiblingOrderChanged (QDeclarativeItem *)
 
virtual void itemVisibilityChanged (QDeclarativeItem *)
 

Static Public Functions

static void data_append (QDeclarativeListProperty< QObject > *, QObject *)
 
static QObjectdata_at (QDeclarativeListProperty< QObject > *, int)
 
static void data_clear (QDeclarativeListProperty< QObject > *)
 
static int data_count (QDeclarativeListProperty< QObject > *)
 
static void fixupX_callback (void *)
 
static void fixupY_callback (void *)
 
- Static Public Functions inherited from QDeclarativeItemPrivate
static void data_append (QDeclarativeListProperty< QObject > *, QObject *)
 
static QObjectdata_at (QDeclarativeListProperty< QObject > *, int)
 
static void data_clear (QDeclarativeListProperty< QObject > *)
 
static int data_count (QDeclarativeListProperty< QObject > *)
 
static qint64 elapsed (QElapsedTimer &)
 
static QDeclarativeItemPrivateget (QDeclarativeItem *item)
 
static void parentProperty (QObject *o, void *rv, QDeclarativeNotifierEndpoint *e)
 
static void resources_append (QDeclarativeListProperty< QObject > *, QObject *)
 
static QObjectresources_at (QDeclarativeListProperty< QObject > *, int)
 
static void resources_clear (QDeclarativeListProperty< QObject > *)
 
static int resources_count (QDeclarativeListProperty< QObject > *)
 
static qint64 restart (QElapsedTimer &)
 
static void setConsistentTime (qint64 t)
 
static void start (QElapsedTimer &)
 
static void transform_append (QDeclarativeListProperty< QGraphicsTransform > *list, QGraphicsTransform *)
 
static QGraphicsTransformtransform_at (QDeclarativeListProperty< QGraphicsTransform > *list, int)
 
static void transform_clear (QDeclarativeListProperty< QGraphicsTransform > *list)
 
static int transform_count (QDeclarativeListProperty< QGraphicsTransform > *list)
 
- Static Public Functions inherited from QGraphicsItemPrivate
static void children_append (QDeclarativeListProperty< QGraphicsObject > *list, QGraphicsObject *item)
 
static QGraphicsObjectchildren_at (QDeclarativeListProperty< QGraphicsObject > *list, int)
 
static void children_clear (QDeclarativeListProperty< QGraphicsObject > *list)
 
static int children_count (QDeclarativeListProperty< QGraphicsObject > *list)
 
static const QGraphicsItemPrivateget (const QGraphicsItem *item)
 
static QGraphicsItemPrivateget (QGraphicsItem *item)
 
static bool insertionOrder (QGraphicsItem *a, QGraphicsItem *b)
 
static bool isOpacityNull (qreal opacity)
 
static bool movableAncestorIsSelected (const QGraphicsItem *item)
 

Public Variables

QDeclarativeFlickable::BoundsBehavior boundsBehavior
 
bool calcVelocity: 1
 
QDeclarativeItemcontentItem
 
qreal deceleration
 
QGraphicsSceneMouseEventdelayedPressEvent
 
QGraphicsItemdelayedPressTarget
 
QBasicTimer delayedPressTimer
 
int fixupDuration
 
FixupMode fixupMode
 
QDeclarativeFlickable::FlickableDirection flickableDirection
 
AxisData hData
 
bool hMoved: 1
 
bool interactive: 1
 
QPointF lastFlickablePosition
 
QPointF lastPos
 
QElapsedTimer lastPosTime
 
qreal maxVelocity
 
int pressDelay
 
bool pressed: 1
 
QPointF pressPos
 
QElapsedTimer pressTime
 
qreal reportedVelocitySmoothing
 
bool stealMouse: 1
 
QDeclarativeTimeLine timeline
 
AxisData vData
 
QElapsedTimer velocityTime
 
QDeclarativeTimeLine velocityTimeline
 
QDeclarativeFlickableVisibleAreavisibleArea
 
bool vMoved: 1
 
int vTime
 
- Public Variables inherited from QDeclarativeItemPrivate
AnchorLines_anchorLines
 
QDeclarativeAnchors_anchors
 
QDeclarativeContents_contents
 
QDeclarativeStateGroup_stateGroup
 
QDeclarativeLayoutMirroringAttachedattachedLayoutDirection
 
QDeclarativeNullableValue< qrealbaselineOffset
 
QPODVector< ChangeListener, 4 > changeListeners
 
bool componentComplete:1
 
bool doneEventPreHandler: 1
 
bool effectiveLayoutMirror:1
 
bool hadActiveFocus:1
 
bool hadFocus:1
 
bool heightValid:1
 
bool inheritedLayoutMirror:1
 
bool inheritMirrorFromItem:1
 
bool inheritMirrorFromParent:1
 
bool isMirrorImplicit:1
 
bool keepMouse:1
 
QDeclarativeItemKeyFilterkeyHandler
 
qreal mHeight
 
qreal mImplicitHeight
 
qreal mImplicitWidth
 
qreal mWidth
 
QDeclarativeItem::TransformOrigin origin:5
 
QDeclarativeNotifier parentNotifier
 
bool smooth:1
 
bool transformOriginDirty: 1
 
bool widthValid:1
 
- Public Variables inherited from QGraphicsItemPrivate
quint32 acceptDrops: 1
 
quint32 acceptedMouseButtons: 5
 
quint32 acceptedTouchBeginEvent: 1
 
quint32 acceptsHover: 1
 
quint32 acceptTouchEvents: 1
 
quint32 allChildrenDirty: 1
 
quint32 ancestorFlags: 4
 
quint32 cacheMode: 2
 
QList< QGraphicsItem * > children
 
QRectF childrenBoundingRect
 
quint32 dirty: 1
 
quint32 dirtyChildren: 1
 
quint32 dirtyChildrenBoundingRect: 1
 
quint32 dirtySceneTransform: 1
 
quint32 enabled: 1
 
quint32 explicitActivate: 1
 
quint32 explicitlyDisabled: 1
 
quint32 explicitlyHidden: 1
 
QList< ExtraStructextras
 
quint32 filtersDescendantEvents: 1
 
quint32 flags: 19
 
QGraphicsItemfocusProxy
 
QList< QGraphicsItem ** > focusProxyRefs
 
QGraphicsItemfocusScopeItem
 
quint32 fullUpdatePending: 1
 
quint32 geometryChanged: 1
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
int globalStackingOrder
 
QGraphicsEffectgraphicsEffect
 
quint32 handlesChildEvents: 1
 
quint32 hasBoundingRegionGranularity: 1
 
quint32 hasCursor: 1
 
quint32 holesInSiblingIndex: 1
 
quint32 ignoreOpacity: 1
 
quint32 ignoreVisible: 1
 
Qt::InputMethodHints imHints
 
quint32 inDestructor: 1
 
int index
 
quint32 inSetPosHelper: 1
 
quint32 isDeclarativeItem: 1
 
quint32 isMemberOfGroup: 1
 
quint32 isObject: 1
 
quint32 isWidget: 1
 
int itemDepth
 
quint32 itemDiscovered: 1
 
quint32 localCollisionHack: 1
 
quint32 mayHaveChildWithGraphicsEffect: 1
 
quint32 mouseSetsFocus: 1
 
quint32 needSortChildren: 1
 
QRectF needsRepaint
 
quint32 notifyBoundingRectChanged: 1
 
quint32 notifyInvalidated: 1
 
qreal opacity
 
quint32 padding: 21
 
QMap< QWidget *, QRectpaintedViewBoundingRects
 
quint32 paintedViewBoundingRectsNeedRepaint: 1
 
QGraphicsItem::PanelModality panelModality
 
QGraphicsItemparent
 
quint32 pendingPolish: 1
 
QPointF pos
 
QGraphicsItemq_ptr
 
QGraphicsScenescene
 
quint32 scenePosDescendants: 1
 
QTransform sceneTransform
 
quint32 sceneTransformTranslateOnly: 1
 
quint32 selected: 1
 
quint32 sendParentChangeNotification: 1
 
quint32 sequentialOrdering: 1
 
int siblingIndex
 
QGraphicsItemsubFocusItem
 
TransformDatatransformData
 
quint32 updateDueToGraphicsEffect: 1
 
quint32 visible: 1
 
quint32 wantsActive: 1
 
qreal z
 

Additional Inherited Members

- Static Public Variables inherited from QDeclarativeItemPrivate
static qint64 consistentTime = -1
 

Detailed Description

Definition at line 78 of file qdeclarativeflickable_p_p.h.

Enumerations

◆ FixupMode

Constructors and Destructors

◆ QDeclarativeFlickablePrivate()

QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate ( )

Definition at line 167 of file qdeclarativeflickable.cpp.

171  , hMoved(false), vMoved(false)
172  , stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
176  , fixupMode(Normal), vTime(0), visibleArea(0)
179 {
180 }
The QDeclarativeItem class provides the most basic of all visual items in QML.
QGraphicsSceneMouseEvent * delayedPressEvent
QDeclarativeFlickable::FlickableDirection flickableDirection
#define QML_FLICK_DEFAULTDECELERATION
QDeclarativeFlickableVisibleArea * visibleArea
#define QML_FLICK_DEFAULTMAXVELOCITY
QDeclarativeFlickable::BoundsBehavior boundsBehavior

Functions

◆ captureDelayedPress()

void QDeclarativeFlickablePrivate::captureDelayedPress ( QGraphicsSceneMouseEvent event)

Definition at line 1056 of file qdeclarativeflickable.cpp.

1057 {
1059  if (!q->scene() || pressDelay <= 0)
1060  return;
1061  if (!isOutermostPressDelay())
1062  return;
1066  for (int i = 0x1; i <= 0x10; i <<= 1) {
1067  if (event->buttons() & i) {
1068  Qt::MouseButton button = Qt::MouseButton(i);
1069  delayedPressEvent->setButtonDownPos(button, event->buttonDownPos(button));
1072  }
1073  }
1075  delayedPressEvent->setButton(event->button());
1076  delayedPressEvent->setPos(event->pos());
1084 }
QPoint screenPos() const
Returns the mouse cursor position in screen coordinates.
void setModifiers(Qt::KeyboardModifiers modifiers)
void setLastPos(const QPointF &pos)
void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos)
void setScreenPos(const QPoint &pos)
void setAccepted(bool accepted)
Definition: qcoreevent.h:306
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
Qt::MouseButton button() const
Returns the mouse button (if any) that caused the event.
void setButtonDownPos(Qt::MouseButton button, const QPointF &pos)
void setButtons(Qt::MouseButtons buttons)
void setScenePos(const QPointF &pos)
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse...
#define Q_Q(Class)
Definition: qglobal.h:2483
QPointF buttonDownScenePos(Qt::MouseButton button) const
Returns the mouse cursor position in scene coordinates where the specified button was clicked...
QPointF lastScenePos() const
Returns the last recorded mouse cursor position in scene coordinates.
QGraphicsSceneMouseEvent * delayedPressEvent
void setPos(const QPointF &pos)
void setLastScenePos(const QPointF &pos)
QPoint lastScreenPos() const
Returns the last recorded mouse cursor position in screen coordinates.
QPointF scenePos() const
Returns the mouse cursor position in scene coordinates.
QPoint buttonDownScreenPos(Qt::MouseButton button) const
Returns the mouse cursor position in screen coordinates where the specified button was clicked...
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.
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void setLastScreenPos(const QPoint &pos)
void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos)
void setButton(Qt::MouseButton button)
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
void start(int msec, QObject *obj)
Starts (or restarts) the timer with a msec milliseconds timeout.
QPointF lastPos() const
Returns the last recorded mouse cursor position in item coordinates.
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent...
MouseButton
Definition: qnamespace.h:150

◆ clearDelayedPress()

void QDeclarativeFlickablePrivate::clearDelayedPress ( )

Definition at line 1086 of file qdeclarativeflickable.cpp.

1087 {
1088  if (delayedPressEvent) {
1090  delete delayedPressEvent;
1091  delayedPressEvent = 0;
1092  }
1093 }
QGraphicsSceneMouseEvent * delayedPressEvent
void stop()
Stops the timer.

◆ data_append()

void QDeclarativeFlickablePrivate::data_append ( QDeclarativeListProperty< QObject > *  prop,
QObject o 
)
static

Definition at line 1253 of file qdeclarativeflickable.cpp.

Referenced by data_clear().

1254 {
1256  if (i) {
1258  if (static_cast<QDeclarativeItemPrivate*>(d)->componentComplete) {
1259  i->setParentItem(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem);
1260  } else {
1261  d->setParentItemHelper(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem, 0, 0);
1262  }
1263  } else {
1264  o->setParent(prop->object);
1265  }
1266 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
double d
Definition: qnumeric_p.h:62
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant, const QVariant *thisPointerVariant)
Make sure not to trigger any pure virtual function calls (e.
void setParentItem(QGraphicsItem *parent)
Sets this item&#39;s parent item to newParent.
void setParent(QObject *)
Makes the object a child of parent.
Definition: qobject.cpp:1950
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
The QGraphicsObject class provides a base class for all graphics items that require signals...

◆ data_at()

QObject * QDeclarativeFlickablePrivate::data_at ( QDeclarativeListProperty< QObject > *  property,
int  index 
)
static

Definition at line 1274 of file qdeclarativeflickable.cpp.

Referenced by data_clear().

1275 {
1276  QDeclarativeItem *contentItem = static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem;
1277 
1278  int childItemCount = contentItem->childItems().count();
1279 
1280  if (index < 0)
1281  return 0;
1282 
1283  if (index < childItemCount) {
1284  return contentItem->childItems().at(index)->toGraphicsObject();
1285  } else {
1286  return contentItem->children().at(index - childItemCount);
1287  }
1288 
1289  return 0;
1290 }
QList< QGraphicsItem * > childItems() const
Returns a list of this item&#39;s children.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QGraphicsObject * toGraphicsObject()
Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object...
The QDeclarativeItem class provides the most basic of all visual items in QML.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
const QObjectList & children() const
Returns a list of child objects.
Definition: qobject.h:197

◆ data_clear()

void QDeclarativeFlickablePrivate::data_clear ( QDeclarativeListProperty< QObject > *  property)
static

Definition at line 1292 of file qdeclarativeflickable.cpp.

1293 {
1294  QDeclarativeItem *contentItem = static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem;
1295 
1296  const QList<QGraphicsItem*> graphicsItems = contentItem->childItems();
1297  for (int i = 0; i < graphicsItems.count(); i++)
1298  contentItem->scene()->removeItem(graphicsItems[i]);
1299 
1300  const QList<QObject*> objects = contentItem->children();
1301  for (int i = 0; i < objects.count(); i++)
1302  objects[i]->setParent(0);
1303 }
QList< QGraphicsItem * > childItems() const
Returns a list of this item&#39;s children.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QDeclarativeItem class provides the most basic of all visual items in QML.
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
const QObjectList & children() const
Returns a list of child objects.
Definition: qobject.h:197
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ data_count()

int QDeclarativeFlickablePrivate::data_count ( QDeclarativeListProperty< QObject > *  property)
static

Definition at line 1268 of file qdeclarativeflickable.cpp.

Referenced by data_clear().

1269 {
1270  QDeclarativeItem *contentItem= static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem;
1271  return contentItem->childItems().count() + contentItem->children().count();
1272 }
QList< QGraphicsItem * > childItems() const
Returns a list of this item&#39;s children.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QDeclarativeItem class provides the most basic of all visual items in QML.
const QObjectList & children() const
Returns a list of child objects.
Definition: qobject.h:197

◆ fixup()

void QDeclarativeFlickablePrivate::fixup ( AxisData data,
qreal  minExtent,
qreal  maxExtent 
)
virtual

Reimplemented in QDeclarativeListViewPrivate, and QDeclarativeGridViewPrivate.

Definition at line 337 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridViewPrivate::fixup(), QDeclarativeListViewPrivate::fixup(), fixupX(), fixupY(), and flick().

338 {
339  if (data.move.value() > minExtent || maxExtent > minExtent) {
340  timeline.reset(data.move);
341  if (data.move.value() != minExtent) {
342  switch (fixupMode) {
343  case Immediate:
344  timeline.set(data.move, minExtent);
345  break;
346  case ExtentChanged:
347  // The target has changed. Don't start from the beginning; just complete the
348  // second half of the animation using the new extent.
350  data.fixingUp = true;
351  break;
352  default: {
353  qreal dist = minExtent - data.move;
354  timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
356  data.fixingUp = true;
357  }
358  }
359  }
360  } else if (data.move.value() < maxExtent) {
361  timeline.reset(data.move);
362  switch (fixupMode) {
363  case Immediate:
364  timeline.set(data.move, maxExtent);
365  break;
366  case ExtentChanged:
367  // The target has changed. Don't start from the beginning; just complete the
368  // second half of the animation using the new extent.
370  data.fixingUp = true;
371  break;
372  default: {
373  qreal dist = maxExtent - data.move;
374  timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
376  data.fixingUp = true;
377  }
378  }
379  }
380  data.inOvershoot = false;
381  fixupMode = Normal;
382  vTime = timeline.time();
383 }
double qreal
Definition: qglobal.h:1193
The QEasingCurve class provides easing curves for controlling animation.
Definition: qeasingcurve.h:55
void move(QDeclarativeTimeLineValue &, qreal destination, int time=500)
Linearly change the timeLineValue from its current value to the given destination value over time mil...
void reset(QDeclarativeTimeLineValue &)
Cancel (but don&#39;t complete) all scheduled actions for timeLineValue.
void set(QDeclarativeTimeLineValue &, qreal)
Set the value of timeLineValue.
QDeclarativeListProperty< QObject > data()

◆ fixupX()

void QDeclarativeFlickablePrivate::fixupX ( )

Definition at line 325 of file qdeclarativeflickable.cpp.

326 {
328  fixup(hData, q->minXExtent(), q->maxXExtent());
329 }
#define Q_Q(Class)
Definition: qglobal.h:2483
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)

◆ fixupX_callback()

void QDeclarativeFlickablePrivate::fixupX_callback ( void *  data)
static

Definition at line 320 of file qdeclarativeflickable.cpp.

Referenced by flickX().

321 {
322  ((QDeclarativeFlickablePrivate *)data)->fixupX();
323 }
QDeclarativeListProperty< QObject > data()

◆ fixupY()

void QDeclarativeFlickablePrivate::fixupY ( )

Definition at line 331 of file qdeclarativeflickable.cpp.

332 {
334  fixup(vData, q->minYExtent(), q->maxYExtent());
335 }
#define Q_Q(Class)
Definition: qglobal.h:2483
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)

◆ fixupY_callback()

void QDeclarativeFlickablePrivate::fixupY_callback ( void *  data)
static

Definition at line 315 of file qdeclarativeflickable.cpp.

Referenced by flickY().

316 {
317  ((QDeclarativeFlickablePrivate *)data)->fixupY();
318 }
QDeclarativeListProperty< QObject > data()

◆ flick()

void QDeclarativeFlickablePrivate::flick ( AxisData data,
qreal  minExtent,
qreal  maxExtent,
qreal  vSize,
QDeclarativeTimeLineCallback::Callback  fixupCallback,
qreal  velocity 
)
virtual

Reimplemented in QDeclarativeListViewPrivate, and QDeclarativeGridViewPrivate.

Definition at line 267 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridViewPrivate::flick(), QDeclarativeListViewPrivate::flick(), flickX(), and flickY().

269 {
271  qreal maxDistance = -1;
272  data.fixingUp = false;
273  // -ve velocity means list is moving up
274  if (velocity > 0) {
275  maxDistance = qAbs(minExtent - data.move.value());
276  data.flickTarget = minExtent;
277  } else {
278  maxDistance = qAbs(maxExtent - data.move.value());
279  data.flickTarget = maxExtent;
280  }
281  if (maxDistance > 0) {
282  qreal v = velocity;
283  if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
284  if (v < 0)
285  v = -maxVelocity;
286  else
287  v = maxVelocity;
288  }
289  timeline.reset(data.move);
291  timeline.accel(data.move, v, deceleration);
292  else
293  timeline.accel(data.move, v, deceleration, maxDistance);
294  timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
295  if (!hData.flicking && q->xflick()) {
296  hData.flicking = true;
297  emit q->flickingChanged();
298  emit q->flickingHorizontallyChanged();
299  if (!vData.flicking)
300  emit q->flickStarted();
301  }
302  if (!vData.flicking && q->yflick()) {
303  vData.flicking = true;
304  emit q->flickingChanged();
305  emit q->flickingVerticallyChanged();
306  if (!hData.flicking)
307  emit q->flickStarted();
308  }
309  } else {
310  timeline.reset(data.move);
311  fixup(data, minExtent, maxExtent);
312  }
313 }
double qreal
Definition: qglobal.h:1193
int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel)
Decelerate timeLineValue from the starting velocity to zero at the given acceleration rate...
void reset(QDeclarativeTimeLineValue &)
Cancel (but don&#39;t complete) all scheduled actions for timeLineValue.
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
void callback(const QDeclarativeTimeLineCallback &)
Execute the event.
QDeclarativeListProperty< QObject > data()
QDeclarativeFlickable::BoundsBehavior boundsBehavior

◆ flickX()

void QDeclarativeFlickablePrivate::flickX ( qreal  velocity)

Definition at line 255 of file qdeclarativeflickable.cpp.

256 {
258  flick(hData, q->minXExtent(), q->maxXExtent(), q->width(), fixupX_callback, velocity);
259 }
#define Q_Q(Class)
Definition: qglobal.h:2483
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)

◆ flickY()

void QDeclarativeFlickablePrivate::flickY ( qreal  velocity)

Definition at line 261 of file qdeclarativeflickable.cpp.

262 {
264  flick(vData, q->minYExtent(), q->maxYExtent(), q->height(), fixupY_callback, velocity);
265 }
#define Q_Q(Class)
Definition: qglobal.h:2483
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)

◆ handleMouseMoveEvent()

void QDeclarativeFlickablePrivate::handleMouseMoveEvent ( QGraphicsSceneMouseEvent event)

Definition at line 814 of file qdeclarativeflickable.cpp.

815 {
817  if (!interactive || !lastPosTime.isValid())
818  return;
819  bool rejectY = false;
820  bool rejectX = false;
821 
822  bool stealY = stealMouse;
823  bool stealX = stealMouse;
824 
825  if (q->yflick()) {
826  int dy = int(event->pos().y() - pressPos.y());
828  if (!vMoved)
829  vData.dragStartOffset = dy;
830  qreal newY = dy + vData.pressPos - vData.dragStartOffset;
831  const qreal minY = vData.dragMinBound;
832  const qreal maxY = vData.dragMaxBound;
833  if (newY > minY)
834  newY = minY + (newY - minY) / 2;
835  if (newY < maxY && maxY - minY <= 0)
836  newY = maxY + (newY - maxY) / 2;
837  if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && newY <= maxY) {
838  newY = maxY;
839  rejectY = vData.pressPos == maxY && dy < 0;
840  }
841  if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && newY >= minY) {
842  newY = minY;
843  rejectY = vData.pressPos == minY && dy > 0;
844  }
845  if (!rejectY && stealMouse && dy != 0) {
846  vData.move.setValue(qRound(newY));
847  vMoved = true;
848  }
849  if (!rejectY && qAbs(dy) > QApplication::startDragDistance())
850  stealY = true;
851  }
852  }
853 
854  if (q->xflick()) {
855  int dx = int(event->pos().x() - pressPos.x());
857  if (!hMoved)
858  hData.dragStartOffset = dx;
859  qreal newX = dx + hData.pressPos - hData.dragStartOffset;
860  const qreal minX = hData.dragMinBound;
861  const qreal maxX = hData.dragMaxBound;
862  if (newX > minX)
863  newX = minX + (newX - minX) / 2;
864  if (newX < maxX && maxX - minX <= 0)
865  newX = maxX + (newX - maxX) / 2;
866  if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && newX <= maxX) {
867  newX = maxX;
868  rejectX = hData.pressPos == maxX && dx < 0;
869  }
870  if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && newX >= minX) {
871  newX = minX;
872  rejectX = hData.pressPos == minX && dx > 0;
873  }
874  if (!rejectX && stealMouse && dx != 0) {
875  hData.move.setValue(qRound(newX));
876  hMoved = true;
877  }
878 
879  if (!rejectX && qAbs(dx) > QApplication::startDragDistance())
880  stealX = true;
881  }
882  }
883 
884  stealMouse = stealX || stealY;
885  if (stealMouse)
886  q->setKeepMouseGrab(true);
887 
888  if (rejectY) {
890  vData.velocity = 0;
891  }
892  if (rejectX) {
894  hData.velocity = 0;
895  }
896 
897  if (hMoved || vMoved) {
898  q->movementStarting();
899  q->viewportMoved();
900  }
901 
902  if (!lastPos.isNull()) {
904  if (elapsed <= 0)
905  return;
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);
913  }
914 
915  lastPos = event->pos();
916 }
double qreal
Definition: qglobal.h:1193
virtual void setValue(qreal v)
Set the current value.
static qint64 elapsed(QElapsedTimer &)
void clear()
Definition: qpodvector_p.h:77
bool isValid() const
Returns false if this object was invalidated by a call to invalidate() and has not been restarted sin...
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
#define Q_Q(Class)
Definition: qglobal.h:2483
static int startDragDistance()
void addVelocitySample(qreal v, qreal maxVelocity)
QDeclarativeTimeLineValueProxy< QDeclarativeFlickablePrivate > move
static qint64 restart(QElapsedTimer &)
bool isNull() const
Returns true if both the x and y coordinates are set to +0.
Definition: qpoint.h:277
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
QPointF pos() const
Returns the mouse cursor position in item coordinates.
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
QDeclarativeFlickable::BoundsBehavior boundsBehavior

◆ handleMousePressEvent()

void QDeclarativeFlickablePrivate::handleMousePressEvent ( QGraphicsSceneMouseEvent event)

Definition at line 785 of file qdeclarativeflickable.cpp.

786 {
788  if (interactive && timeline.isActive()
790  stealMouse = true; // If we've been flicked then steal the click.
791  else
792  stealMouse = false;
793  q->setKeepMouseGrab(stealMouse);
794  pressed = true;
795  timeline.clear();
796  hData.reset();
797  vData.reset();
798  hData.dragMinBound = q->minXExtent();
799  vData.dragMinBound = q->minYExtent();
800  hData.dragMaxBound = q->maxXExtent();
801  vData.dragMaxBound = q->maxYExtent();
802  fixupMode = Normal;
803  lastPos = QPoint();
805  pressPos = event->pos();
808  hData.flicking = false;
809  vData.flicking = false;
812 }
static const int RetainGrabVelocity
QDeclarativeFlickablePrivate::Velocity smoothVelocity
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isActive() const
Returns true if the timeline is active.
void clear()
Resets the timeline.
virtual qreal value() const
Return the current value.
static void start(QElapsedTimer &)
QDeclarativeTimeLineValueProxy< QDeclarativeFlickablePrivate > move
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53

◆ handleMouseReleaseEvent()

void QDeclarativeFlickablePrivate::handleMouseReleaseEvent ( QGraphicsSceneMouseEvent event)

Definition at line 918 of file qdeclarativeflickable.cpp.

919 {
921  stealMouse = false;
922  q->setKeepMouseGrab(false);
923  pressed = false;
924  if (!lastPosTime.isValid())
925  return;
926 
927  // if we drag then pause before release we should not cause a flick.
929 
932  vTime = timeline.time();
933 
934  qreal velocity = elapsed < 100 ? vData.velocity : 0;
935  if (vData.atBeginning || vData.atEnd)
936  velocity /= 2;
937  if (q->yflick() && qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold) {
939  vData.smoothVelocity.setValue(-velocity);
940  flickY(velocity);
941  } else {
942  fixupY();
943  }
944 
945  velocity = elapsed < 100 ? hData.velocity : 0;
946  if (hData.atBeginning || hData.atEnd)
947  velocity /= 2;
948  if (q->xflick() && qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().x() - pressPos.x()) > FlickThreshold) {
950  hData.smoothVelocity.setValue(-velocity);
951  flickX(velocity);
952  } else {
953  fixupX();
954  }
955 
956  if (!timeline.isActive())
957  q->movementEnding();
958 }
double qreal
Definition: qglobal.h:1193
static qint64 elapsed(QElapsedTimer &)
QDeclarativeFlickablePrivate::Velocity smoothVelocity
bool isValid() const
Returns false if this object was invalidated by a call to invalidate() and has not been restarted sin...
void reset(QDeclarativeTimeLineValue &)
Cancel (but don&#39;t complete) all scheduled actions for timeLineValue.
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isActive() const
Returns true if the timeline is active.
const qreal MinimumFlickVelocity
__int64 qint64
Definition: qglobal.h:942
virtual void setValue(qreal v)
Set the current value.
static const int FlickThreshold
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
QPointF pos() const
Returns the mouse cursor position in item coordinates.

◆ init()

void QDeclarativeFlickablePrivate::init ( )

Definition at line 182 of file qdeclarativeflickable.cpp.

183 {
187  static int timelineUpdatedIdx = -1;
188  static int timelineCompletedIdx = -1;
189  static int flickableTickedIdx = -1;
190  static int flickableMovementEndingIdx = -1;
191  if (timelineUpdatedIdx == -1) {
192  timelineUpdatedIdx = QDeclarativeTimeLine::staticMetaObject.indexOfSignal("updated()");
193  timelineCompletedIdx = QDeclarativeTimeLine::staticMetaObject.indexOfSignal("completed()");
194  flickableTickedIdx = QDeclarativeFlickable::staticMetaObject.indexOfSlot("ticked()");
195  flickableMovementEndingIdx = QDeclarativeFlickable::staticMetaObject.indexOfSlot("movementEnding()");
196  }
197  QMetaObject::connect(&timeline, timelineUpdatedIdx,
198  q, flickableTickedIdx, Qt::DirectConnection);
199  QMetaObject::connect(&timeline, timelineCompletedIdx,
200  q, flickableMovementEndingIdx, Qt::DirectConnection);
201  q->setAcceptedMouseButtons(Qt::LeftButton);
202  q->setFiltersChildEvents(true);
206 }
static bool connect(const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=0)
Definition: qobject.cpp:3194
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Definition: qobject.h:128
#define Q_Q(Class)
Definition: qglobal.h:2483
void setParentItem(QDeclarativeItem *parent)
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
void invalidate()
Marks this QElapsedTimer object as invalid.
int indexOfSlot(const char *slot) const
Finds slot and returns its index; otherwise returns -1.
int indexOfSignal(const char *signal) const
Finds signal and returns its index; otherwise returns -1.
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)

◆ isOutermostPressDelay()

bool QDeclarativeFlickablePrivate::isOutermostPressDelay ( ) const

Definition at line 1042 of file qdeclarativeflickable.cpp.

1043 {
1044  Q_Q(const QDeclarativeFlickable);
1045  QDeclarativeItem *item = q->parentItem();
1046  while (item) {
1048  if (flick && flick->pressDelay() > 0 && flick->isInteractive())
1049  return false;
1050  item = item->parentItem();
1051  }
1052 
1053  return true;
1054 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
#define Q_Q(Class)
Definition: qglobal.h:2483
The QDeclarativeItem class provides the most basic of all visual items in QML.
QDeclarativeItem * parentItem() const
Returns the QDeclarativeItem parent of this item.
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)

◆ itemGeometryChanged()

void QDeclarativeFlickablePrivate::itemGeometryChanged ( QDeclarativeItem item,
const QRectF newGeom,
const QRectF oldGeom 
)
virtual

Reimplemented from QDeclarativeItemChangeListener.

Reimplemented in QDeclarativeListViewPrivate, and QDeclarativeGridViewPrivate.

Definition at line 244 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridViewPrivate::itemGeometryChanged(), and QDeclarativeListViewPrivate::itemGeometryChanged().

245 {
247  if (item == contentItem) {
248  if (newGeom.x() != oldGeom.x())
249  emit q->contentXChanged();
250  if (newGeom.y() != oldGeom.y())
251  emit q->contentYChanged();
252  }
253 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ overShootDistance()

qreal QDeclarativeFlickablePrivate::overShootDistance ( qreal  size)

Definition at line 212 of file qdeclarativeflickable.cpp.

213 {
214  if (maxVelocity <= 0)
215  return 0.0;
216 
217  return qMin(qreal(QML_FLICK_OVERSHOOT), size/3);
218 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define QML_FLICK_OVERSHOOT

◆ setRoundedViewportX()

void QDeclarativeFlickablePrivate::setRoundedViewportX ( qreal  x)

Definition at line 1095 of file qdeclarativeflickable.cpp.

1096 {
1097  contentItem->setX(qRound(x));
1098 }
void setX(qreal x)
Set&#39;s the x coordinate of the item&#39;s position.
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ setRoundedViewportY()

void QDeclarativeFlickablePrivate::setRoundedViewportY ( qreal  y)

Definition at line 1100 of file qdeclarativeflickable.cpp.

1101 {
1102  contentItem->setY(qRound(y));
1103 }
void setY(qreal y)
Set&#39;s the y coordinate of the item&#39;s position.
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ updateBeginningEnd()

void QDeclarativeFlickablePrivate::updateBeginningEnd ( )

Definition at line 385 of file qdeclarativeflickable.cpp.

386 {
388  bool atBoundaryChange = false;
389 
390  // Vertical
391  const int maxyextent = int(-q->maxYExtent());
392  const qreal ypos = -vData.move.value();
393  bool atBeginning = (ypos <= -q->minYExtent());
394  bool atEnd = (maxyextent <= ypos);
395 
396  if (atBeginning != vData.atBeginning) {
397  vData.atBeginning = atBeginning;
398  atBoundaryChange = true;
399  }
400  if (atEnd != vData.atEnd) {
401  vData.atEnd = atEnd;
402  atBoundaryChange = true;
403  }
404 
405  // Horizontal
406  const int maxxextent = int(-q->maxXExtent());
407  const qreal xpos = -hData.move.value();
408  atBeginning = (xpos <= -q->minXExtent());
409  atEnd = (maxxextent <= xpos);
410 
411  if (atBeginning != hData.atBeginning) {
412  hData.atBeginning = atBeginning;
413  atBoundaryChange = true;
414  }
415  if (atEnd != hData.atEnd) {
416  hData.atEnd = atEnd;
417  atBoundaryChange = true;
418  }
419 
420  if (atBoundaryChange)
421  emit q->isAtBoundaryChanged();
422 
423  if (visibleArea)
425 }
double qreal
Definition: qglobal.h:1193
#define Q_Q(Class)
Definition: qglobal.h:2483
virtual qreal value() const
Return the current value.
#define emit
Definition: qobjectdefs.h:76
QDeclarativeTimeLineValueProxy< QDeclarativeFlickablePrivate > move
QDeclarativeFlickableVisibleArea * visibleArea

◆ updateVelocity()

void QDeclarativeFlickablePrivate::updateVelocity ( )

Definition at line 1855 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeFlickablePrivate::AxisData::reset(), and QDeclarativeFlickablePrivate::Velocity::setValue().

1856 {
1858  emit q->horizontalVelocityChanged();
1859  emit q->verticalVelocityChanged();
1860 }
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76

Properties

◆ boundsBehavior

QDeclarativeFlickable::BoundsBehavior QDeclarativeFlickablePrivate::boundsBehavior

Definition at line 194 of file qdeclarativeflickable_p_p.h.

Referenced by flick().

◆ calcVelocity

bool QDeclarativeFlickablePrivate::calcVelocity

Definition at line 167 of file qdeclarativeflickable_p_p.h.

◆ contentItem

QDeclarativeItem* QDeclarativeFlickablePrivate::contentItem

Definition at line 156 of file qdeclarativeflickable_p_p.h.

Referenced by init(), and itemGeometryChanged().

◆ deceleration

qreal QDeclarativeFlickablePrivate::deceleration

Definition at line 172 of file qdeclarativeflickable_p_p.h.

Referenced by flick().

◆ delayedPressEvent

QGraphicsSceneMouseEvent* QDeclarativeFlickablePrivate::delayedPressEvent

Definition at line 177 of file qdeclarativeflickable_p_p.h.

◆ delayedPressTarget

QGraphicsItem* QDeclarativeFlickablePrivate::delayedPressTarget

Definition at line 178 of file qdeclarativeflickable_p_p.h.

◆ delayedPressTimer

QBasicTimer QDeclarativeFlickablePrivate::delayedPressTimer

Definition at line 179 of file qdeclarativeflickable_p_p.h.

◆ fixupDuration

int QDeclarativeFlickablePrivate::fixupDuration

Definition at line 181 of file qdeclarativeflickable_p_p.h.

Referenced by fixup().

◆ fixupMode

FixupMode QDeclarativeFlickablePrivate::fixupMode

Definition at line 184 of file qdeclarativeflickable_p_p.h.

Referenced by fixup().

◆ flickableDirection

QDeclarativeFlickable::FlickableDirection QDeclarativeFlickablePrivate::flickableDirection

Definition at line 193 of file qdeclarativeflickable_p_p.h.

◆ hData

AxisData QDeclarativeFlickablePrivate::hData

◆ hMoved

bool QDeclarativeFlickablePrivate::hMoved

Definition at line 162 of file qdeclarativeflickable_p_p.h.

◆ interactive

bool QDeclarativeFlickablePrivate::interactive

Definition at line 166 of file qdeclarativeflickable_p_p.h.

◆ lastFlickablePosition

QPointF QDeclarativeFlickablePrivate::lastFlickablePosition

Definition at line 175 of file qdeclarativeflickable_p_p.h.

◆ lastPos

QPointF QDeclarativeFlickablePrivate::lastPos

Definition at line 169 of file qdeclarativeflickable_p_p.h.

◆ lastPosTime

QElapsedTimer QDeclarativeFlickablePrivate::lastPosTime

Definition at line 168 of file qdeclarativeflickable_p_p.h.

Referenced by init().

◆ maxVelocity

qreal QDeclarativeFlickablePrivate::maxVelocity

◆ pressDelay

int QDeclarativeFlickablePrivate::pressDelay

Definition at line 180 of file qdeclarativeflickable_p_p.h.

◆ pressed

bool QDeclarativeFlickablePrivate::pressed

Definition at line 165 of file qdeclarativeflickable_p_p.h.

◆ pressPos

QPointF QDeclarativeFlickablePrivate::pressPos

Definition at line 170 of file qdeclarativeflickable_p_p.h.

◆ pressTime

QElapsedTimer QDeclarativeFlickablePrivate::pressTime

Definition at line 171 of file qdeclarativeflickable_p_p.h.

◆ reportedVelocitySmoothing

qreal QDeclarativeFlickablePrivate::reportedVelocitySmoothing

Definition at line 176 of file qdeclarativeflickable_p_p.h.

◆ stealMouse

bool QDeclarativeFlickablePrivate::stealMouse

Definition at line 164 of file qdeclarativeflickable_p_p.h.

◆ timeline

QDeclarativeTimeLine QDeclarativeFlickablePrivate::timeline

Definition at line 161 of file qdeclarativeflickable_p_p.h.

Referenced by fixup(), flick(), and init().

◆ vData

AxisData QDeclarativeFlickablePrivate::vData

◆ velocityTime

QElapsedTimer QDeclarativeFlickablePrivate::velocityTime

Definition at line 174 of file qdeclarativeflickable_p_p.h.

◆ velocityTimeline

QDeclarativeTimeLine QDeclarativeFlickablePrivate::velocityTimeline

Definition at line 191 of file qdeclarativeflickable_p_p.h.

◆ visibleArea

QDeclarativeFlickableVisibleArea* QDeclarativeFlickablePrivate::visibleArea

Definition at line 192 of file qdeclarativeflickable_p_p.h.

Referenced by updateBeginningEnd().

◆ vMoved

bool QDeclarativeFlickablePrivate::vMoved

Definition at line 163 of file qdeclarativeflickable_p_p.h.

◆ vTime

int QDeclarativeFlickablePrivate::vTime

Definition at line 190 of file qdeclarativeflickable_p_p.h.

Referenced by fixup().


The documentation for this class was generated from the following files: