Qt 4.8
Public Types | Signals | Public Functions | Protected Slots | Protected Functions | Properties | Friends | List of all members
QDeclarativeFlickable Class Reference

#include <qdeclarativeflickable_p.h>

Inheritance diagram for QDeclarativeFlickable:
QDeclarativeItem QGraphicsObject QDeclarativeParserStatus QObject QGraphicsItem QDeclarativeGridView QDeclarativeListView

Public Types

enum  BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds }
 
enum  FlickableDirection { AutoFlickDirection =0x00, HorizontalFlick =0x01, VerticalFlick =0x02, HorizontalAndVerticalFlick =0x03 }
 
- Public Types inherited from QDeclarativeItem
enum  TransformOrigin {
  TopLeft, Top, TopRight, Left,
  Center, Right, BottomLeft, Bottom,
  BottomRight
}
 Controls the point about which simple transforms like scale apply. More...
 
- Public Types inherited from QGraphicsItem
enum  { Type = 1, UserType = 65536 }
 
enum  CacheMode { NoCache, ItemCoordinateCache, DeviceCoordinateCache }
 This enum describes QGraphicsItem's cache modes. More...
 
enum  GraphicsItemChange {
  ItemPositionChange, ItemMatrixChange, ItemVisibleChange, ItemEnabledChange,
  ItemSelectedChange, ItemParentChange, ItemChildAddedChange, ItemChildRemovedChange,
  ItemTransformChange, ItemPositionHasChanged, ItemTransformHasChanged, ItemSceneChange,
  ItemVisibleHasChanged, ItemEnabledHasChanged, ItemSelectedHasChanged, ItemParentHasChanged,
  ItemSceneHasChanged, ItemCursorChange, ItemCursorHasChanged, ItemToolTipChange,
  ItemToolTipHasChanged, ItemFlagsChange, ItemFlagsHaveChanged, ItemZValueChange,
  ItemZValueHasChanged, ItemOpacityChange, ItemOpacityHasChanged, ItemScenePositionHasChanged,
  ItemRotationChange, ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
  ItemTransformOriginPointChange, ItemTransformOriginPointHasChanged
}
 This enum describes the state changes that are notified by QGraphicsItem::itemChange(). More...
 
enum  GraphicsItemFlag {
  ItemIsMovable = 0x1, ItemIsSelectable = 0x2, ItemIsFocusable = 0x4, ItemClipsToShape = 0x8,
  ItemClipsChildrenToShape = 0x10, ItemIgnoresTransformations = 0x20, ItemIgnoresParentOpacity = 0x40, ItemDoesntPropagateOpacityToChildren = 0x80,
  ItemStacksBehindParent = 0x100, ItemUsesExtendedStyleOption = 0x200, ItemHasNoContents = 0x400, ItemSendsGeometryChanges = 0x800,
  ItemAcceptsInputMethod = 0x1000, ItemNegativeZStacksBehindParent = 0x2000, ItemIsPanel = 0x4000, ItemIsFocusScope = 0x8000,
  ItemSendsScenePositionChanges = 0x10000, ItemStopsClickFocusPropagation = 0x20000, ItemStopsFocusHandling = 0x40000
}
 This enum describes different flags that you can set on an item to toggle different features in the item's behavior. More...
 
enum  PanelModality { NonModal, PanelModal, SceneModal }
 This enum specifies the behavior of a modal panel. More...
 

Signals

void boundsBehaviorChanged ()
 
void contentHeightChanged ()
 
void contentWidthChanged ()
 
void contentXChanged ()
 
void contentYChanged ()
 
void flickableDirectionChanged ()
 
void flickDecelerationChanged ()
 
void flickEnded ()
 
void flickingChanged ()
 
void flickingHorizontallyChanged ()
 
void flickingVerticallyChanged ()
 
void flickStarted ()
 
void horizontalVelocityChanged ()
 
void interactiveChanged ()
 
void isAtBoundaryChanged ()
 
void maximumFlickVelocityChanged ()
 
void movementEnded ()
 
void movementStarted ()
 
void movingChanged ()
 
void movingHorizontallyChanged ()
 
void movingVerticallyChanged ()
 
void pressDelayChanged ()
 
void verticalVelocityChanged ()
 
- Signals inherited from QDeclarativeItem
void activeFocusChanged (bool)
 
void baselineOffsetChanged (qreal)
 
void childrenRectChanged (const QRectF &)
 
void clipChanged (bool)
 
void focusChanged (bool)
 
void implicitHeightChanged ()
 
void implicitWidthChanged ()
 
void parentChanged (QDeclarativeItem *)
 
void smoothChanged (bool)
 
void stateChanged (const QString &)
 
void transformOriginChanged (TransformOrigin)
 
- Signals inherited from QGraphicsObject
void childrenChanged ()
 This signal gets emitted whenever the children list changes. More...
 
void enabledChanged ()
 This signal gets emitted whenever the item get's enabled or disabled. More...
 
void heightChanged ()
 
void opacityChanged ()
 This signal gets emitted whenever the opacity of the item changes. More...
 
void parentChanged ()
 This signal gets emitted whenever the parent of the item changes. More...
 
void rotationChanged ()
 This signal gets emitted whenever the roation of the item changes. More...
 
void scaleChanged ()
 This signal is emitted when the scale of the item changes. More...
 
void visibleChanged ()
 This signal gets emitted whenever the visibility of the item changes. More...
 
void widthChanged ()
 
void xChanged ()
 This signal gets emitted whenever the x position of the item changes. More...
 
void yChanged ()
 This signal gets emitted whenever the y position of the item changes. More...
 
void zChanged ()
 This signal gets emitted whenever the z value of the item changes. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

BoundsBehavior boundsBehavior () const
 
qreal contentHeight () const
 
QDeclarativeItemcontentItem ()
 
qreal contentWidth () const
 
qreal contentX () const
 
qreal contentY () const
 
QDeclarativeListProperty< QGraphicsObjectflickableChildren ()
 
QDeclarativeListProperty< QObjectflickableData ()
 
FlickableDirection flickableDirection () const
 
qreal flickDeceleration () const
 
qreal horizontalVelocity () const
 
bool isAtXBeginning () const
 
bool isAtXEnd () const
 
bool isAtYBeginning () const
 
bool isAtYEnd () const
 
bool isFlicking () const
 
bool isFlickingHorizontally () const
 
bool isFlickingVertically () const
 
bool isInteractive () const
 
bool isMoving () const
 
bool isMovingHorizontally () const
 
bool isMovingVertically () const
 
qreal maximumFlickVelocity () const
 
int pressDelay () const
 
 QDeclarativeFlickable (QDeclarativeItem *parent=0)
 
Q_INVOKABLE void resizeContent (qreal w, qreal h, QPointF center)
 
Q_INVOKABLE void returnToBounds ()
 
void setBoundsBehavior (BoundsBehavior)
 
void setContentHeight (qreal)
 
void setContentWidth (qreal)
 
virtual void setContentX (qreal pos)
 
virtual void setContentY (qreal pos)
 
void setFlickableDirection (FlickableDirection)
 
void setFlickDeceleration (qreal)
 
void setInteractive (bool)
 
void setMaximumFlickVelocity (qreal)
 
void setPressDelay (int delay)
 
qreal verticalVelocity () const
 
 ~QDeclarativeFlickable ()
 
- Public Functions inherited from QDeclarativeItem
qreal baselineOffset () const
 
QRectF boundingRect () const
 
Q_INVOKABLE QDeclarativeItemchildAt (qreal x, qreal y) const
 Returns the visible child item at point (x, y), which is in this item's coordinate system, or 0 if there is no such item. More...
 
QRectF childrenRect ()
 
bool clip () const
 
Q_INVOKABLE void forceActiveFocus ()
 Forces active focus on the item. More...
 
bool hasActiveFocus () const
 
bool hasFocus () const
 
qreal height () const
 
qreal implicitHeight () const
 
qreal implicitWidth () const
 
bool keepMouseGrab () const
 Returns a value indicating whether mouse input should remain with this item exclusively. More...
 
Q_INVOKABLE QScriptValue mapFromItem (const QScriptValue &item, qreal x, qreal y) const
 Maps the point (x, y), which is in item's coordinate system, to this item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate. More...
 
Q_INVOKABLE QScriptValue mapToItem (const QScriptValue &item, qreal x, qreal y) const
 Maps the point (x, y), which is in this item's coordinate system, to item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate. More...
 
virtual void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
 
QDeclarativeItemparentItem () const
 Returns the QDeclarativeItem parent of this item. More...
 
 QDeclarativeItem (QDeclarativeItem *parent=0)
 Constructs a QDeclarativeItem with the given parent. More...
 
void resetHeight ()
 
void resetWidth ()
 
void setBaselineOffset (qreal)
 
void setClip (bool)
 
void setFocus (bool)
 
void setHeight (qreal)
 
void setKeepMouseGrab (bool)
 The flag indicating whether the mouse should remain with this item is set to keep. More...
 
void setParentItem (QDeclarativeItem *parent)
 
void setSize (const QSizeF &size)
 
void setSmooth (bool)
 Sets whether the item should be drawn with antialiasing and smooth pixmap filtering to smooth. More...
 
void setTransformOrigin (TransformOrigin)
 Set the transform origin. More...
 
void setWidth (qreal)
 
bool smooth () const
 
QDeclarativeListProperty< QGraphicsTransformtransform ()
 
TransformOrigin transformOrigin () const
 
qreal width () const
 
virtual ~QDeclarativeItem ()
 Destroys the QDeclarativeItem. More...
 
- Public Functions inherited from QGraphicsObject
void grabGesture (Qt::GestureType type, Qt::GestureFlags flags=Qt::GestureFlags())
 Subscribes the graphics object to the given gesture with specific flags. More...
 
 QGraphicsObject (QGraphicsItem *parent=0)
 Constructs a QGraphicsObject with parent. More...
 
void ungrabGesture (Qt::GestureType type)
 Unsubscribes the graphics object from the given gesture. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QGraphicsItem
bool acceptDrops () const
 Returns true if this item can accept drag and drop events; otherwise, returns false. More...
 
Qt::MouseButtons acceptedMouseButtons () const
 Returns the mouse buttons that this item accepts mouse events for. More...
 
bool acceptHoverEvents () const
 Returns true if an item accepts hover events (QGraphicsSceneHoverEvent); otherwise, returns false. More...
 
bool acceptsHoverEvents () const
 Call acceptHoverEvents() instead. More...
 
bool acceptTouchEvents () const
 Returns true if an item accepts touch events; otherwise, returns false. More...
 
virtual void advance (int phase)
 This virtual function is called twice for all items by the QGraphicsScene::advance() slot. More...
 
QRegion boundingRegion (const QTransform &itemToDeviceTransform) const
 Returns the bounding region for this item. More...
 
qreal boundingRegionGranularity () const
 Returns the item's bounding region granularity; a value between and including 0 and 1. More...
 
CacheMode cacheMode () const
 Returns the cache mode for this item. More...
 
QList< QGraphicsItem * > childItems () const
 Returns a list of this item's children. More...
 
QList< QGraphicsItem * > children () const
 Use childItems() instead. More...
 
QRectF childrenBoundingRect () const
 Returns the bounding rect of this item's descendants (i.e., its children, their children, etc.) in local coordinates. More...
 
void clearFocus ()
 Takes keyboard input focus from the item. More...
 
QPainterPath clipPath () const
 Returns this item's clip path, or an empty QPainterPath if this item is not clipped. More...
 
virtual bool collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns true if this item collides with other; otherwise returns false. More...
 
virtual bool collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns true if this item collides with path. More...
 
QList< QGraphicsItem * > collidingItems (Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns a list of all items that collide with this item. More...
 
QGraphicsItemcommonAncestorItem (const QGraphicsItem *other) const
 Returns the closest common ancestor item of this item and other, or 0 if either other is 0, or there is no common ancestor. More...
 
virtual bool contains (const QPointF &point) const
 Returns true if this item contains point, which is in local coordinates; otherwise, false is returned. More...
 
QCursor cursor () const
 Returns the current cursor shape for the item. More...
 
QVariant data (int key) const
 Returns this item's custom data for the key key as a QVariant. More...
 
QTransform deviceTransform (const QTransform &viewportTransform) const
 Returns this item's device transformation matrix, using viewportTransform to map from scene to device coordinates. More...
 
qreal effectiveOpacity () const
 Returns this item's effective opacity, which is between 0. More...
 
void ensureVisible (const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
 If this item is part of a scene that is viewed by a QGraphicsView, this convenience function will attempt to scroll the view to ensure that rect is visible inside the view's viewport. More...
 
void ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin=50, int ymargin=50)
 This convenience function is equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin): More...
 
bool filtersChildEvents () const
 Returns true if this item filters child events (i. More...
 
GraphicsItemFlags flags () const
 Returns this item's flags. More...
 
QGraphicsItemfocusItem () const
 If this item, a child or descendant of this item currently has input focus, this function will return a pointer to that item. More...
 
QGraphicsItemfocusProxy () const
 Returns this item's focus proxy, or 0 if this item has no focus proxy. More...
 
QGraphicsItemfocusScopeItem () const
 Returns this item's focus scope item. More...
 
void grabKeyboard ()
 Grabs the keyboard input. More...
 
void grabMouse ()
 Grabs the mouse input. More...
 
QGraphicsEffectgraphicsEffect () const
 Returns a pointer to this item's effect if it has one; otherwise 0. More...
 
QGraphicsItemGroupgroup () const
 Returns a pointer to this item's item group, or 0 if this item is not member of a group. More...
 
bool handlesChildEvents () const
 Returns true if this item handles child events (i. More...
 
bool hasCursor () const
 Returns true if this item has a cursor set; otherwise, false is returned. More...
 
bool hasFocus () const
 Returns true if this item is active, and it or its focus proxy has keyboard input focus; otherwise, returns false. More...
 
void hide ()
 Hides the item. More...
 
Qt::InputMethodHints inputMethodHints () const
 Returns the current input method hints of this item. More...
 
void installSceneEventFilter (QGraphicsItem *filterItem)
 Installs an event filter for this item on filterItem, causing all events for this item to first pass through filterItem's sceneEventFilter() function. More...
 
bool isActive () const
 Returns true if this item is active; otherwise returns false. More...
 
bool isAncestorOf (const QGraphicsItem *child) const
 Returns true if this item is an ancestor of child (i.e., if this item is child's parent, or one of child's parent's ancestors). More...
 
bool isBlockedByModalPanel (QGraphicsItem **blockingPanel=0) const
 Returns true if this item is blocked by a modal panel, false otherwise. More...
 
bool isClipped () const
 Returns true if this item is clipped. More...
 
bool isEnabled () const
 Returns true if the item is enabled; otherwise, false is returned. More...
 
bool isObscured () const
 Returns true if this item's bounding rect is completely obscured by the opaque shape of any of colliding items above it (i.e., with a higher Z value than this item). More...
 
bool isObscured (const QRectF &rect) const
 Returns true if rect is completely obscured by the opaque shape of any of colliding items above it (i. More...
 
bool isObscured (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling isObscured(QRectF(x, y, w, h)). More...
 
virtual bool isObscuredBy (const QGraphicsItem *item) const
 Returns true if this item's bounding rect is completely obscured by the opaque shape of item. More...
 
bool isPanel () const
 Returns true if the item is a panel; otherwise returns false. More...
 
bool isSelected () const
 Returns true if this item is selected; otherwise, false is returned. More...
 
bool isUnderMouse () const
 Returns true if this item is currently under the mouse cursor in one of the views; otherwise, false is returned. More...
 
bool isVisible () const
 Returns true if the item is visible; otherwise, false is returned. More...
 
bool isVisibleTo (const QGraphicsItem *parent) const
 Returns true if the item is visible to parent; otherwise, false is returned. More...
 
bool isWidget () const
 Returns true if this item is a widget (i. More...
 
bool isWindow () const
 Returns true if the item is a QGraphicsWidget window, otherwise returns false. More...
 
QTransform itemTransform (const QGraphicsItem *other, bool *ok=0) const
 Returns a QTransform that maps coordinates from this item to other. More...
 
QPointF mapFromItem (const QGraphicsItem *item, const QPointF &point) const
 Maps the point point, which is in item's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 Maps the polygon polygon, which is in item's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const
 Maps the path path, which is in item's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapFromItem(item, QPointF(x, y)). More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapFromParent (const QPointF &point) const
 Maps the point point, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromParent (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromParent (const QPainterPath &path) const
 Maps the path path, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromParent (qreal x, qreal y) const
 This convenience function is equivalent to calling mapFromParent(QPointF(x, y)). More...
 
QPolygonF mapFromParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapFromItem(QRectF(x, y, w, h)). More...
 
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 system, and returns the mapped coordinate. More...
 
QPolygonF mapFromScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromScene (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromScene (const QPainterPath &path) const
 Maps the path path, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromScene (qreal x, qreal y) const
 This convenience function is equivalent to calling mapFromScene(QPointF(x, y)). More...
 
QPolygonF mapFromScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapFromScene(QRectF(x, y, w, h)). More...
 
QRectF mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectFromParent(QRectF(x, y, w, h)). More...
 
QRectF mapRectFromScene (const QRectF &rect) const
 Maps the rectangle rect, which is in scene coordinates, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectFromScene(QRectF(x, y, w, h)). More...
 
QRectF mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectToParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectToParent(QRectF(x, y, w, h)). More...
 
QRectF mapRectToScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to the scene coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectToScene(QRectF(x, y, w, h)). More...
 
QPointF mapToItem (const QGraphicsItem *item, const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToItem (const QGraphicsItem *item, const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to item's coordinate system, and returns the mapped path. More...
 
QPointF mapToItem (const QGraphicsItem *item, qreal x, qreal y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapToItem(item, QPointF(x, y)). More...
 
QPolygonF mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapToParent (const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToParent (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToParent (const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped path. More...
 
QPointF mapToParent (qreal x, qreal y) const
 This convenience function is equivalent to calling mapToParent(QPointF(x, y)). More...
 
QPolygonF mapToParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapToParent(QRectF(x, y, w, h)). More...
 
QPointF mapToScene (const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToScene (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToScene (const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped path. More...
 
QPointF mapToScene (qreal x, qreal y) const
 This convenience function is equivalent to calling mapToScene(QPointF(x, y)). More...
 
QPolygonF mapToScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapToScene(QRectF(x, y, w, h)). More...
 
QMatrix matrix () const
 Returns the item's affine transformation matrix. More...
 
void moveBy (qreal dx, qreal dy)
 Moves the item by dx points horizontally, and dy point vertically. More...
 
qreal opacity () const
 Returns this item's local opacity, which is between 0. More...
 
virtual QPainterPath opaqueArea () const
 This virtual function returns a shape representing the area where this item is opaque. More...
 
QGraphicsItempanel () const
 Returns the item's panel, or 0 if this item does not have a panel. More...
 
PanelModality panelModality () const
 Returns the modality for this item. More...
 
QGraphicsItemparentItem () const
 Returns a pointer to this item's parent item. More...
 
QGraphicsObjectparentObject () const
 Returns a pointer to the item's parent, cast to a QGraphicsObject. More...
 
QGraphicsWidgetparentWidget () const
 Returns a pointer to the item's parent widget. More...
 
QPointF pos () const
 Returns the position of the item in parent coordinates. More...
 
 QGraphicsItem (QGraphicsItem *parent=0)
 Constructs a QGraphicsItem with the given parent item. More...
 
void removeSceneEventFilter (QGraphicsItem *filterItem)
 Removes an event filter on this item from filterItem. More...
 
void resetMatrix ()
 Use resetTransform() instead. More...
 
void resetTransform ()
 Resets this item's transformation matrix to the identity matrix or all the transformation properties to their default values. More...
 
void rotate (qreal angle)
 Use. More...
 
qreal rotation () const
 Returns the clockwise rotation, in degrees, around the Z axis. More...
 
void scale (qreal sx, qreal sy)
 Use. More...
 
qreal scale () const
 Returns the scale factor of the item. More...
 
QGraphicsScenescene () const
 Returns the current scene for the item, or 0 if the item is not stored in a scene. More...
 
QRectF sceneBoundingRect () const
 Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with boundingRect(). More...
 
QMatrix sceneMatrix () const
 Use sceneTransform() instead. More...
 
QPointF scenePos () const
 Returns the item's position in scene coordinates. More...
 
QTransform sceneTransform () const
 Returns this item's scene transformation matrix. More...
 
void scroll (qreal dx, qreal dy, const QRectF &rect=QRectF())
 Scrolls the contents of rect by dx, dy. More...
 
void setAcceptDrops (bool on)
 If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and drop events. More...
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 Sets the mouse buttons that this item accepts mouse events for. More...
 
void setAcceptHoverEvents (bool enabled)
 If enabled is true, this item will accept hover events; otherwise, it will ignore them. More...
 
void setAcceptsHoverEvents (bool enabled)
 Use setAcceptHoverEvents(enabled) instead. More...
 
void setAcceptTouchEvents (bool enabled)
 If enabled is true, this item will accept touch events; otherwise, it will ignore them. More...
 
void setActive (bool active)
 If active is true, and the scene is active, this item's panel will be activated. More...
 
void setBoundingRegionGranularity (qreal granularity)
 Sets the bounding region granularity to granularity; a value between and including 0 and 1. More...
 
void setCacheMode (CacheMode mode, const QSize &cacheSize=QSize())
 Sets the item's cache mode to mode. More...
 
void setCursor (const QCursor &cursor)
 Sets the current cursor shape for the item to cursor. More...
 
void setData (int key, const QVariant &value)
 Sets this item's custom data for the key key to value. More...
 
void setEnabled (bool enabled)
 If enabled is true, the item is enabled; otherwise, it is disabled. More...
 
void setFiltersChildEvents (bool enabled)
 If enabled is true, this item is set to filter all events for all its children (i. More...
 
void setFlag (GraphicsItemFlag flag, bool enabled=true)
 If enabled is true, the item flag flag is enabled; otherwise, it is disabled. More...
 
void setFlags (GraphicsItemFlags flags)
 Sets the item flags to flags. More...
 
void setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason)
 Gives keyboard input focus to this item. More...
 
void setFocusProxy (QGraphicsItem *item)
 Sets the item's focus proxy to item. More...
 
void setGraphicsEffect (QGraphicsEffect *effect)
 Sets effect as the item's effect. More...
 
void setGroup (QGraphicsItemGroup *group)
 Adds this item to the item group group. More...
 
void setHandlesChildEvents (bool enabled)
 If enabled is true, this item is set to handle all events for all its children (i. More...
 
void setInputMethodHints (Qt::InputMethodHints hints)
 Sets the current input method hints of this item to hints. More...
 
void setMatrix (const QMatrix &matrix, bool combine=false)
 Sets the item's affine transformation matrix. More...
 
void setOpacity (qreal opacity)
 Sets this item's local opacity, between 0. More...
 
void setPanelModality (PanelModality panelModality)
 Sets the modality for this item to panelModality. More...
 
void setParentItem (QGraphicsItem *parent)
 Sets this item's parent item to newParent. More...
 
void setPos (const QPointF &pos)
 Sets the position of the item to pos, which is in parent coordinates. More...
 
void setPos (qreal x, qreal y)
 This convenience function is equivalent to calling setPos(QPointF(x, y)). More...
 
void setRotation (qreal angle)
 Sets the clockwise rotation angle, in degrees, around the Z axis. More...
 
void setScale (qreal scale)
 Sets the scale factor of the item. More...
 
void setSelected (bool selected)
 If selected is true and this item is selectable, this item is selected; otherwise, it is unselected. More...
 
void setToolTip (const QString &toolTip)
 Sets the item's tool tip to toolTip. More...
 
void setTransform (const QTransform &matrix, bool combine=false)
 Sets the item's current transformation matrix to matrix. More...
 
void setTransformations (const QList< QGraphicsTransform *> &transformations)
 Sets a list of graphics transformations (QGraphicsTransform) that currently apply to this item. More...
 
void setTransformOriginPoint (const QPointF &origin)
 Sets the origin point for the transformation in item coordinates. More...
 
void setTransformOriginPoint (qreal ax, qreal ay)
 Sets the origin point for the transformation in item coordinates. More...
 
void setVisible (bool visible)
 If visible is true, the item is made visible. More...
 
void setX (qreal x)
 Set's the x coordinate of the item's position. More...
 
void setY (qreal y)
 Set's the y coordinate of the item's position. More...
 
void setZValue (qreal z)
 Sets the Z-value of the item to z. More...
 
virtual QPainterPath shape () const
 Returns the shape of this item as a QPainterPath in local coordinates. More...
 
void shear (qreal sh, qreal sv)
 Use. More...
 
void show ()
 Shows the item. More...
 
void stackBefore (const QGraphicsItem *sibling)
 Stacks this item before sibling, which must be a sibling item (i. More...
 
QGraphicsObjecttoGraphicsObject ()
 Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object, 0 otherwise. More...
 
const QGraphicsObjecttoGraphicsObject () const
 Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object, 0 otherwise. More...
 
QString toolTip () const
 Returns the item's tool tip, or an empty QString if no tool tip has been set. More...
 
QGraphicsItemtopLevelItem () const
 Returns this item's top-level item. More...
 
QGraphicsWidgettopLevelWidget () const
 Returns a pointer to the item's top level widget (i. More...
 
QTransform transform () const
 Returns this item's transformation matrix. More...
 
QList< QGraphicsTransform * > transformations () const
 Returns a list of graphics transforms that currently apply to this item. More...
 
QPointF transformOriginPoint () const
 Returns the origin point for the transformation in item coordinates. More...
 
void translate (qreal dx, qreal dy)
 Use setPos() or setTransformOriginPoint() instead. More...
 
virtual int type () const
 Returns the type of an item as an int. More...
 
void ungrabKeyboard ()
 Releases the keyboard grab. More...
 
void ungrabMouse ()
 Releases the mouse grab. More...
 
void unsetCursor ()
 Clears the cursor from this item. More...
 
void update (const QRectF &rect=QRectF())
 Schedules a redraw of the area covered by rect in this item. More...
 
void update (qreal x, qreal y, qreal width, qreal height)
 This convenience function is equivalent to calling update(QRectF(x, y, width, height)). More...
 
QGraphicsWidgetwindow () const
 Returns the item's window, or 0 if this item does not have a window. More...
 
qreal x () const
 This convenience function is equivalent to calling pos(). More...
 
qreal y () const
 This convenience function is equivalent to calling pos(). More...
 
qreal zValue () const
 Returns the Z-value of the item. More...
 
virtual ~QGraphicsItem ()
 Destroys the QGraphicsItem and all its children. More...
 
- Public Functions inherited from QDeclarativeParserStatus
 QDeclarativeParserStatus ()
 
virtual ~QDeclarativeParserStatus ()
 

Protected Slots

void movementEnding ()
 
void movementStarting ()
 
virtual void ticked ()
 
- Protected Slots inherited from QGraphicsObject
void updateMicroFocus ()
 Updates the item's micro focus. More...
 

Protected Functions

void cancelFlick ()
 
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. More...
 
virtual qreal maxXExtent () const
 
virtual qreal maxYExtent () const
 
virtual qreal minXExtent () const
 
virtual qreal minYExtent () const
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse move events for this item. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse press events for this item. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse release events for this item. More...
 
void movementXEnding ()
 
void movementYEnding ()
 
 QDeclarativeFlickable (QDeclarativeFlickablePrivate &dd, QDeclarativeItem *parent)
 
bool sceneEvent (QEvent *event)
 
virtual bool sceneEventFilter (QGraphicsItem *, QEvent *)
 Filters events for the item watched. More...
 
bool sendMouseEvent (QGraphicsSceneMouseEvent *event)
 
void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
qreal vHeight () const
 
virtual void viewportMoved ()
 
QDeclarativeFlickableVisibleAreavisibleArea ()
 
qreal vWidth () const
 
void wheelEvent (QGraphicsSceneWheelEvent *event)
 This event handler, for event event, can be reimplemented to receive wheel events for this item. More...
 
bool xflick () const
 
bool yflick () const
 
- Protected Functions inherited from QDeclarativeItem
virtual void classBegin ()
 
virtual void componentComplete ()
 
virtual bool event (QEvent *)
 
bool heightValid () const
 Returns whether the height property has been set explicitly. More...
 
virtual void inputMethodEvent (QInputMethodEvent *)
 
void inputMethodPreHandler (QInputMethodEvent *)
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
bool isComponentComplete () const
 Returns true if construction of the QML component is complete; otherwise returns false. More...
 
virtual QVariant itemChange (GraphicsItemChange, const QVariant &)
 Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is not called during initial widget polishing. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 
void keyPressPreHandler (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
void keyReleasePreHandler (QKeyEvent *)
 
 QDeclarativeItem (QDeclarativeItemPrivate &dd, QDeclarativeItem *parent=0)
 
void setImplicitHeight (qreal)
 Sets the implied height of the item to h. More...
 
void setImplicitWidth (qreal)
 Sets the implied width of the item to w. More...
 
bool widthValid () const
 Returns whether the width property has been set explicitly. More...
 
- Protected Functions inherited from QGraphicsObject
 QGraphicsObject (QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
- Protected Functions inherited from QGraphicsItem
void addToIndex ()
 Adds this item to the scene's index. More...
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 This event handler can be reimplemented in a subclass to process context menu events. More...
 
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag enter events for this item. More...
 
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag leave events for this item. More...
 
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag move events for this item. More...
 
virtual void dropEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drop events for this item. More...
 
virtual QVariant extension (const QVariant &variant) const
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
virtual void focusInEvent (QFocusEvent *event)
 This event handler, for event event, can be reimplemented to receive focus in events for this item. More...
 
virtual void focusOutEvent (QFocusEvent *event)
 This event handler, for event event, can be reimplemented to receive focus out events for this item. More...
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover enter events for this item. More...
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover leave events for this item. More...
 
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover move events for this item. More...
 
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse doubleclick events for this item. More...
 
void prepareGeometryChange ()
 Prepares the item for a geometry change. More...
 
 QGraphicsItem (QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene)
 
void removeFromIndex ()
 Removes this item from the scene's index. More...
 
virtual void setExtension (Extension extension, const QVariant &variant)
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
virtual bool supportsExtension (Extension extension) const
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
void updateMicroFocus ()
 Updates the item's micro focus. More...
 

Properties

bool atXBeginning
 
bool atXEnd
 
bool atYBeginning
 
bool atYEnd
 
BoundsBehavior boundsBehavior
 
qreal contentHeight
 
QDeclarativeItemcontentItem
 
qreal contentWidth
 
qreal contentX
 
qreal contentY
 
QDeclarativeListProperty< QGraphicsObjectflickableChildren
 
QDeclarativeListProperty< QObjectflickableData
 
FlickableDirection flickableDirection
 
qreal flickDeceleration
 
bool flicking
 
bool flickingHorizontally
 
bool flickingVertically
 
qreal horizontalVelocity
 
bool interactive
 
qreal maximumFlickVelocity
 
bool moving
 
bool movingHorizontally
 
bool movingVertically
 
int pressDelay
 
qreal verticalVelocity
 
QDeclarativeFlickableVisibleAreavisibleArea
 

Friends

class QDeclarativeFlickableVisibleArea
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Types inherited from QGraphicsItem
enum  Extension { UserExtension = 0x80000000 }
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QGraphicsItem
QScopedPointer< QGraphicsItemPrivated_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 55 of file qdeclarativeflickable_p.h.

Enumerations

◆ BoundsBehavior

◆ FlickableDirection

Constructors and Destructors

◆ QDeclarativeFlickable() [1/2]

QDeclarativeFlickable::QDeclarativeFlickable ( QDeclarativeItem parent = 0)

Definition at line 547 of file qdeclarativeflickable.cpp.

549 {
551  d->init();
552 }
QDeclarativeParserStatus ** d
QDeclarativeItem(QDeclarativeItem *parent=0)
Constructs a QDeclarativeItem with the given parent.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ ~QDeclarativeFlickable()

QDeclarativeFlickable::~QDeclarativeFlickable ( )

Definition at line 561 of file qdeclarativeflickable.cpp.

562 {
563 }

◆ QDeclarativeFlickable() [2/2]

QDeclarativeFlickable::QDeclarativeFlickable ( QDeclarativeFlickablePrivate dd,
QDeclarativeItem parent 
)
protected

Definition at line 554 of file qdeclarativeflickable.cpp.

555  : QDeclarativeItem(dd, parent)
556 {
558  d->init();
559 }
QDeclarativeParserStatus ** d
QDeclarativeItem(QDeclarativeItem *parent=0)
Constructs a QDeclarativeItem with the given parent.
#define Q_D(Class)
Definition: qglobal.h:2482

Functions

◆ boundsBehavior()

BoundsBehavior QDeclarativeFlickable::boundsBehavior ( ) const

◆ boundsBehaviorChanged

void QDeclarativeFlickable::boundsBehaviorChanged ( )
signal

Referenced by setBoundsBehavior().

◆ cancelFlick()

void QDeclarativeFlickable::cancelFlick ( )
protected

Definition at line 1245 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridView::trackedPositionChanged(), and QDeclarativeListView::trackedPositionChanged().

1246 {
1248  d->timeline.reset(d->hData.move);
1249  d->timeline.reset(d->vData.move);
1250  movementEnding();
1251 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ contentHeight()

qreal QDeclarativeFlickable::contentHeight ( ) const

Referenced by setContentWidth().

◆ contentHeightChanged

void QDeclarativeFlickable::contentHeightChanged ( )
signal

◆ contentItem()

QDeclarativeItem* QDeclarativeFlickable::contentItem ( )

◆ contentWidth()

qreal QDeclarativeFlickable::contentWidth ( ) const

Referenced by setBoundsBehavior().

◆ contentWidthChanged

void QDeclarativeFlickable::contentWidthChanged ( )
signal

◆ contentX()

qreal QDeclarativeFlickable::contentX ( ) const

◆ contentXChanged

void QDeclarativeFlickable::contentXChanged ( )
signal

◆ contentY()

qreal QDeclarativeFlickable::contentY ( ) const

◆ contentYChanged

void QDeclarativeFlickable::contentYChanged ( )
signal

◆ flickableChildren()

QDeclarativeListProperty<QGraphicsObject> QDeclarativeFlickable::flickableChildren ( )

◆ flickableData()

QDeclarativeListProperty<QObject> QDeclarativeFlickable::flickableData ( )

◆ flickableDirection()

FlickableDirection QDeclarativeFlickable::flickableDirection ( ) const

Referenced by ticked().

◆ flickableDirectionChanged

void QDeclarativeFlickable::flickableDirectionChanged ( )
signal

Referenced by setFlickableDirection().

◆ flickDeceleration()

qreal QDeclarativeFlickable::flickDeceleration ( ) const

Referenced by setMaximumFlickVelocity().

◆ flickDecelerationChanged

void QDeclarativeFlickable::flickDecelerationChanged ( )
signal

Referenced by setFlickDeceleration().

◆ flickEnded

void QDeclarativeFlickable::flickEnded ( )
signal

◆ flickingChanged

void QDeclarativeFlickable::flickingChanged ( )
signal

◆ flickingHorizontallyChanged

void QDeclarativeFlickable::flickingHorizontallyChanged ( )
signal

Referenced by movementXEnding(), and setInteractive().

◆ flickingVerticallyChanged

void QDeclarativeFlickable::flickingVerticallyChanged ( )
signal

Referenced by movementYEnding(), and setInteractive().

◆ flickStarted

void QDeclarativeFlickable::flickStarted ( )
signal

◆ geometryChanged()

void QDeclarativeFlickable::geometryChanged ( const QRectF newGeometry,
const QRectF oldGeometry 
)
protectedvirtual

This function is called to handle this item's changes in geometry from oldGeometry to newGeometry.

If the two geometries are the same, it doesn't do anything.

Reimplemented from QDeclarativeItem.

Reimplemented in QDeclarativeListView.

Definition at line 1207 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeListView::geometryChanged().

1209 {
1211  QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
1212 
1213  bool changed = false;
1214  if (newGeometry.width() != oldGeometry.width()) {
1215  if (xflick())
1216  changed = true;
1217  if (d->hData.viewSize < 0) {
1218  d->contentItem->setWidth(width());
1220  }
1221  // Make sure that we're entirely in view.
1222  if (!d->pressed && !d->hData.moving && !d->vData.moving) {
1224  d->fixupX();
1225  }
1226  }
1227  if (newGeometry.height() != oldGeometry.height()) {
1228  if (yflick())
1229  changed = true;
1230  if (d->vData.viewSize < 0) {
1231  d->contentItem->setHeight(height());
1233  }
1234  // Make sure that we're entirely in view.
1235  if (!d->pressed && !d->hData.moving && !d->vData.moving) {
1237  d->fixupY();
1238  }
1239  }
1240 
1241  if (changed)
1242  d->updateBeginningEnd();
1243 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
#define emit
Definition: qobjectdefs.h:76
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item&#39;s changes in geometry from oldGeometry to newGeometry...

◆ horizontalVelocity()

qreal QDeclarativeFlickable::horizontalVelocity ( ) const

Referenced by setInteractive(), and viewportMoved().

◆ horizontalVelocityChanged

void QDeclarativeFlickable::horizontalVelocityChanged ( )
signal

◆ interactiveChanged

void QDeclarativeFlickable::interactiveChanged ( )
signal

Referenced by setInteractive().

◆ isAtBoundaryChanged

void QDeclarativeFlickable::isAtBoundaryChanged ( )
signal

◆ isAtXBeginning()

bool QDeclarativeFlickable::isAtXBeginning ( ) const

Definition at line 694 of file qdeclarativeflickable.cpp.

695 {
696  Q_D(const QDeclarativeFlickable);
697  return d->hData.atBeginning;
698 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isAtXEnd()

bool QDeclarativeFlickable::isAtXEnd ( ) const

Definition at line 688 of file qdeclarativeflickable.cpp.

689 {
690  Q_D(const QDeclarativeFlickable);
691  return d->hData.atEnd;
692 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isAtYBeginning()

bool QDeclarativeFlickable::isAtYBeginning ( ) const

Definition at line 706 of file qdeclarativeflickable.cpp.

707 {
708  Q_D(const QDeclarativeFlickable);
709  return d->vData.atBeginning;
710 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isAtYEnd()

bool QDeclarativeFlickable::isAtYEnd ( ) const

Definition at line 700 of file qdeclarativeflickable.cpp.

701 {
702  Q_D(const QDeclarativeFlickable);
703  return d->vData.atEnd;
704 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isFlicking()

bool QDeclarativeFlickable::isFlicking ( ) const

Definition at line 1689 of file qdeclarativeflickable.cpp.

1690 {
1691  Q_D(const QDeclarativeFlickable);
1692  return d->hData.flicking || d->vData.flicking;
1693 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isFlickingHorizontally()

bool QDeclarativeFlickable::isFlickingHorizontally ( ) const

Definition at line 1706 of file qdeclarativeflickable.cpp.

1707 {
1708  Q_D(const QDeclarativeFlickable);
1709  return d->hData.flicking;
1710 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isFlickingVertically()

bool QDeclarativeFlickable::isFlickingVertically ( ) const

Definition at line 1712 of file qdeclarativeflickable.cpp.

1713 {
1714  Q_D(const QDeclarativeFlickable);
1715  return d->vData.flicking;
1716 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isInteractive()

bool QDeclarativeFlickable::isInteractive ( ) const

Definition at line 628 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeFlickablePrivate::isOutermostPressDelay().

629 {
630  Q_D(const QDeclarativeFlickable);
631  return d->interactive;
632 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isMoving()

bool QDeclarativeFlickable::isMoving ( ) const

Definition at line 1751 of file qdeclarativeflickable.cpp.

1752 {
1753  Q_D(const QDeclarativeFlickable);
1754  return d->hData.moving || d->vData.moving;
1755 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isMovingHorizontally()

bool QDeclarativeFlickable::isMovingHorizontally ( ) const

Definition at line 1769 of file qdeclarativeflickable.cpp.

1770 {
1771  Q_D(const QDeclarativeFlickable);
1772  return d->hData.moving;
1773 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isMovingVertically()

bool QDeclarativeFlickable::isMovingVertically ( ) const

Definition at line 1775 of file qdeclarativeflickable.cpp.

1776 {
1777  Q_D(const QDeclarativeFlickable);
1778  return d->vData.moving;
1779 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ maximumFlickVelocity()

qreal QDeclarativeFlickable::maximumFlickVelocity ( ) const

Referenced by sceneEventFilter().

◆ maximumFlickVelocityChanged

void QDeclarativeFlickable::maximumFlickVelocityChanged ( )
signal

Referenced by setMaximumFlickVelocity().

◆ maxXExtent()

qreal QDeclarativeFlickable::maxXExtent ( ) const
protectedvirtual

◆ maxYExtent()

qreal QDeclarativeFlickable::maxYExtent ( ) const
protectedvirtual

◆ minXExtent()

qreal QDeclarativeFlickable::minXExtent ( ) const
protectedvirtual

◆ minYExtent()

qreal QDeclarativeFlickable::minYExtent ( ) const
protectedvirtual

◆ mouseMoveEvent()

void QDeclarativeFlickable::mouseMoveEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse move events for this item.

If you do receive this event, you can be certain that this item also received a mouse press event, and that this item is the current mouse grabber.

Calling QEvent::ignore() or QEvent::accept() on event has no effect.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseMoveEvent() in your reimplementation.

Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.

See also
mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 972 of file qdeclarativeflickable.cpp.

973 {
975  if (d->interactive) {
976  d->handleMouseMoveEvent(event);
977  event->accept();
978  } else {
980  }
981 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...

◆ mousePressEvent()

void QDeclarativeFlickable::mousePressEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse press events for this item.

Mouse press events are only delivered to items that accept the mouse button that is pressed. By default, an item accepts all mouse buttons, but you can change this by calling setAcceptedMouseButtons().

The mouse press event decides which item should become the mouse grabber (see QGraphicsScene::mouseGrabberItem()). If you do not reimplement this function, the press event will propagate to any topmost item beneath this item, and no other mouse events will be delivered to this item.

If you do reimplement this function, event will by default be accepted (see QEvent::accept()), and this item is then the mouse grabber. This allows the item to receive future move, release and doubleclick events. If you call QEvent::ignore() on event, this item will lose the mouse grab, and event will propagate to any topmost item beneath. No further mouse events will be delivered to this item unless a new mouse press event is received.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mousePressEvent() in your reimplementation.

The event is for items that are neither QGraphicsItem::ItemIsMovable "movable" nor QGraphicsItem::ItemIsSelectable "selectable". mouseMoveEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 960 of file qdeclarativeflickable.cpp.

961 {
963  if (d->interactive) {
964  if (!d->pressed)
965  d->handleMousePressEvent(event);
966  event->accept();
967  } else {
969  }
970 }
QDeclarativeParserStatus ** d
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
#define Q_D(Class)
Definition: qglobal.h:2482

◆ mouseReleaseEvent()

void QDeclarativeFlickable::mouseReleaseEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse release events for this item.

Calling QEvent::ignore() or QEvent::accept() on event has no effect.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseReleaseEvent() in your reimplementation.

Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.

See also
mousePressEvent(), mouseMoveEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 983 of file qdeclarativeflickable.cpp.

984 {
986  if (d->interactive) {
987  d->clearDelayedPress();
988  d->handleMouseReleaseEvent(event);
989  event->accept();
990  ungrabMouse();
991  } else {
993  }
994 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void ungrabMouse()
Releases the mouse grab.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...

◆ movementEnded

void QDeclarativeFlickable::movementEnded ( )
signal

Referenced by movementXEnding(), and movementYEnding().

◆ movementEnding

void QDeclarativeFlickable::movementEnding ( )
protectedslot

Definition at line 1800 of file qdeclarativeflickable.cpp.

Referenced by cancelFlick().

1801 {
1803  movementXEnding();
1804  movementYEnding();
1805  d->hData.smoothVelocity.setValue(0);
1806  d->vData.smoothVelocity.setValue(0);
1807 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ movementStarted

void QDeclarativeFlickable::movementStarted ( )
signal

Referenced by movementStarting().

◆ movementStarting

void QDeclarativeFlickable::movementStarting ( )
protectedslot

Definition at line 1781 of file qdeclarativeflickable.cpp.

Referenced by wheelEvent().

1782 {
1784  if (d->hMoved && !d->hData.moving) {
1785  d->hData.moving = true;
1786  emit movingChanged();
1788  if (!d->vData.moving)
1790  }
1791  else if (d->vMoved && !d->vData.moving) {
1792  d->vData.moving = true;
1793  emit movingChanged();
1795  if (!d->hData.moving)
1797  }
1798 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void movingHorizontallyChanged()

◆ movementXEnding()

void QDeclarativeFlickable::movementXEnding ( )
protected

Definition at line 1809 of file qdeclarativeflickable.cpp.

Referenced by movementEnding(), and setContentX().

1810 {
1812  if (d->hData.flicking) {
1813  d->hData.flicking = false;
1816  if (!d->vData.flicking)
1817  emit flickEnded();
1818  }
1819  if (!d->pressed && !d->stealMouse) {
1820  if (d->hData.moving) {
1821  d->hData.moving = false;
1822  d->hMoved = false;
1823  emit movingChanged();
1825  if (!d->vData.moving)
1826  emit movementEnded();
1827  }
1828  }
1829  d->hData.fixingUp = false;
1830 }
QDeclarativeParserStatus ** d
void flickingHorizontallyChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void movingHorizontallyChanged()

◆ movementYEnding()

void QDeclarativeFlickable::movementYEnding ( )
protected

Definition at line 1832 of file qdeclarativeflickable.cpp.

Referenced by movementEnding(), and setContentY().

1833 {
1835  if (d->vData.flicking) {
1836  d->vData.flicking = false;
1839  if (!d->hData.flicking)
1840  emit flickEnded();
1841  }
1842  if (!d->pressed && !d->stealMouse) {
1843  if (d->vData.moving) {
1844  d->vData.moving = false;
1845  d->vMoved = false;
1846  emit movingChanged();
1848  if (!d->hData.moving)
1849  emit movementEnded();
1850  }
1851  }
1852  d->vData.fixingUp = false;
1853 }
QDeclarativeParserStatus ** d
void flickingVerticallyChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ movingChanged

void QDeclarativeFlickable::movingChanged ( )
signal

◆ movingHorizontallyChanged

void QDeclarativeFlickable::movingHorizontallyChanged ( )
signal

◆ movingVerticallyChanged

void QDeclarativeFlickable::movingVerticallyChanged ( )
signal

◆ pressDelay()

int QDeclarativeFlickable::pressDelay ( ) const

◆ pressDelayChanged

void QDeclarativeFlickable::pressDelayChanged ( )
signal

Referenced by setPressDelay().

◆ resizeContent()

void QDeclarativeFlickable::resizeContent ( qreal  w,
qreal  h,
QPointF  center 
)

Definition at line 1452 of file qdeclarativeflickable.cpp.

1453 {
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) {
1461  qreal pos = center.x() * w / oldSize;
1462  setContentX(contentX() + pos - center.x());
1463  }
1464  }
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) {
1471  qreal pos = center.y() * h / oldSize;
1472  setContentY(contentY() + pos - center.y());
1473  }
1474  }
1475  d->updateBeginningEnd();
1476 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
qreal contentY() const
qreal contentX() const
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
#define emit
Definition: qobjectdefs.h:76
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
virtual void setContentX(qreal pos)
virtual void setContentY(qreal pos)

◆ returnToBounds()

void QDeclarativeFlickable::returnToBounds ( )

Definition at line 1491 of file qdeclarativeflickable.cpp.

1492 {
1494  d->fixupX();
1495  d->fixupY();
1496 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ sceneEvent()

bool QDeclarativeFlickable::sceneEvent ( QEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativeItem.

Definition at line 1532 of file qdeclarativeflickable.cpp.

1533 {
1534  bool rv = QDeclarativeItem::sceneEvent(event);
1535  if (event->type() == QEvent::UngrabMouse) {
1537  if (d->pressed) {
1538  // if our mouse grab has been removed (probably by another Flickable),
1539  // fix our state
1540  d->pressed = false;
1541  d->stealMouse = false;
1542  setKeepMouseGrab(false);
1543  }
1544  }
1545  return rv;
1546 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual bool sceneEvent(QEvent *)
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ sceneEventFilter()

bool QDeclarativeFlickable::sceneEventFilter ( QGraphicsItem watched,
QEvent event 
)
protectedvirtual

Filters events for the item watched.

event is the filtered event.

Reimplementing this function in a subclass makes it possible for the item to be used as an event filter for other items, intercepting all the events send to those items before they are able to respond.

Reimplementations must return true to prevent further processing of a given event, ensuring that it will not be delivered to the watched item, or return false to indicate that the event should be propagated further by the event system.

See also
installSceneEventFilter()

Reimplemented from QGraphicsItem.

Definition at line 1624 of file qdeclarativeflickable.cpp.

1625 {
1627  if (!isVisible() || !d->interactive || !isEnabled())
1629  switch (e->type()) {
1633  return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
1634  default:
1635  break;
1636  }
1637 
1639 }
QDeclarativeParserStatus ** d
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
bool isEnabled() const
Returns true if the item is enabled; otherwise, false is returned.
#define Q_D(Class)
Definition: qglobal.h:2482
bool sendMouseEvent(QGraphicsSceneMouseEvent *event)
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Filters events for the item watched.

◆ sendMouseEvent()

bool QDeclarativeFlickable::sendMouseEvent ( QGraphicsSceneMouseEvent event)
protected

Definition at line 1548 of file qdeclarativeflickable.cpp.

Referenced by sceneEventFilter().

1549 {
1552  QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
1553 
1554  QGraphicsScene *s = scene();
1556  QGraphicsItem *grabberItem = s ? s->mouseGrabberItem() : 0;
1557  bool disabledItem = grabberItem && !grabberItem->isEnabled();
1558  bool stealThisEvent = d->stealMouse;
1559  if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab() || disabledItem)) {
1560  mouseEvent.setAccepted(false);
1561  for (int i = 0x1; i <= 0x10; i <<= 1) {
1562  if (event->buttons() & i) {
1563  Qt::MouseButton button = Qt::MouseButton(i);
1564  mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
1565  }
1566  }
1567  mouseEvent.setScenePos(event->scenePos());
1568  mouseEvent.setLastScenePos(event->lastScenePos());
1569  mouseEvent.setPos(mapFromScene(event->scenePos()));
1570  mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
1571 
1572  switch(mouseEvent.type()) {
1574  d->handleMouseMoveEvent(&mouseEvent);
1575  break;
1577  if (d->pressed && !event->spontaneous()) // we are already pressed - this is a delayed replay
1578  return false;
1579 
1580  d->handleMousePressEvent(&mouseEvent);
1581  d->captureDelayedPress(event);
1582  stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
1583  break;
1585  if (d->delayedPressEvent) {
1586  // We replay the mouse press but the grabber we had might not be interessted by the event (e.g. overlay)
1587  // so we reset the grabber
1588  if (s->mouseGrabberItem() == d->delayedPressTarget)
1589  d->delayedPressTarget->ungrabMouse();
1590  //Use the event handler that will take care of finding the proper item to propagate the event
1591  QApplication::sendEvent(scene(), d->delayedPressEvent);
1592  d->clearDelayedPress();
1593  // We send the release
1595  // And the event has been consumed
1596  d->stealMouse = false;
1597  d->pressed = false;
1598  return true;
1599  }
1600  d->handleMouseReleaseEvent(&mouseEvent);
1601  break;
1602  default:
1603  break;
1604  }
1606  if ((grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) || disabledItem) {
1607  d->clearDelayedPress();
1608  grabMouse();
1609  }
1610 
1611  return stealThisEvent || d->delayedPressEvent || disabledItem;
1612  } else if (d->lastPosTime.isValid()) {
1613  d->lastPosTime.invalidate();
1614  }
1616  d->clearDelayedPress();
1617  d->stealMouse = false;
1618  d->pressed = false;
1619  }
1620 
1621  return false;
1622 }
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
T * qobject_cast(QObject *object)
Definition: qobject.h:375
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.
#define Q_D(Class)
Definition: qglobal.h:2482
bool sendEvent(QGraphicsItem *item, QEvent *event)
Sends event event to item item through possible event filters.
QPointF lastScenePos() const
Returns the last recorded mouse cursor position in scene coordinates.
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QDeclarativeItem class provides the most basic of all visual items in QML.
bool spontaneous() const
Returns true if the event originated outside the application (a system event); otherwise returns fals...
Definition: qcoreevent.h:304
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item&#39;s scene&#39;s coordinate system, to this item&#39;s coordinate sy...
QPointF scenePos() const
Returns the mouse cursor position in scene coordinates.
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition: qpoint.h:376
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
Definition: qtestmouse.h:71
bool keepMouseGrab() const
Returns a value indicating whether mouse input should remain with this item exclusively.
QPointF buttonDownPos(Qt::MouseButton button) const
Returns the mouse cursor position in item coordinates where the specified button was clicked...
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item&#39;s coordinate system, to the scene&#39;s coordinate system...
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...
MouseButton
Definition: qnamespace.h:150

◆ setBoundsBehavior()

void QDeclarativeFlickable::setBoundsBehavior ( BoundsBehavior  b)

Definition at line 1350 of file qdeclarativeflickable.cpp.

1351 {
1353  if (b == d->boundsBehavior)
1354  return;
1355  d->boundsBehavior = b;
1357 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setContentHeight()

void QDeclarativeFlickable::setContentHeight ( qreal  h)

Definition at line 1413 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridView::setFlow(), and QDeclarativeListView::setOrientation().

1414 {
1416  if (d->vData.viewSize == h)
1417  return;
1418  d->vData.viewSize = h;
1419  if (h < 0)
1420  d->contentItem->setHeight(height());
1421  else
1422  d->contentItem->setHeight(h);
1423  // Make sure that we're entirely in view.
1424  if (!d->pressed && !d->hData.moving && !d->vData.moving) {
1426  d->fixupY();
1427  } else if (!d->pressed && d->vData.fixingUp) {
1429  d->fixupY();
1430  }
1432  d->updateBeginningEnd();
1433 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setContentWidth()

void QDeclarativeFlickable::setContentWidth ( qreal  w)

Definition at line 1385 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridView::setFlow(), and QDeclarativeListView::setOrientation().

1386 {
1388  if (d->hData.viewSize == w)
1389  return;
1390  d->hData.viewSize = w;
1391  if (w < 0)
1392  d->contentItem->setWidth(width());
1393  else
1394  d->contentItem->setWidth(w);
1395  // Make sure that we're entirely in view.
1396  if (!d->pressed && !d->hData.moving && !d->vData.moving) {
1398  d->fixupX();
1399  } else if (!d->pressed && d->hData.fixingUp) {
1401  d->fixupX();
1402  }
1404  d->updateBeginningEnd();
1405 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setContentX()

void QDeclarativeFlickable::setContentX ( qreal  pos)
virtual

Reimplemented in QDeclarativeListView, and QDeclarativeGridView.

Definition at line 582 of file qdeclarativeflickable.cpp.

Referenced by resizeContent(), QDeclarativeGridView::setContentX(), and QDeclarativeListView::setContentX().

583 {
585  d->timeline.reset(d->hData.move);
586  d->vTime = d->timeline.time();
587  movementXEnding();
588  if (-pos != d->hData.move.value()) {
589  d->hData.move.setValue(-pos);
590  viewportMoved();
591  }
592 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setContentY()

void QDeclarativeFlickable::setContentY ( qreal  pos)
virtual

Reimplemented in QDeclarativeListView, and QDeclarativeGridView.

Definition at line 600 of file qdeclarativeflickable.cpp.

Referenced by resizeContent(), QDeclarativeGridView::setContentY(), and QDeclarativeListView::setContentY().

601 {
603  d->timeline.reset(d->vData.move);
604  d->vTime = d->timeline.time();
605  movementYEnding();
606  if (-pos != d->vData.move.value()) {
607  d->vData.move.setValue(-pos);
608  viewportMoved();
609  }
610 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setFlickableDirection()

void QDeclarativeFlickable::setFlickableDirection ( FlickableDirection  direction)

Definition at line 776 of file qdeclarativeflickable.cpp.

Referenced by QDeclarativeGridView::setFlow(), and QDeclarativeListView::setOrientation().

777 {
779  if (direction != d->flickableDirection) {
780  d->flickableDirection = direction;
782  }
783 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void flickableDirectionChanged()
Qt::LayoutDirection direction

◆ setFlickDeceleration()

void QDeclarativeFlickable::setFlickDeceleration ( qreal  deceleration)

Definition at line 1680 of file qdeclarativeflickable.cpp.

1681 {
1683  if (deceleration == d->deceleration)
1684  return;
1685  d->deceleration = deceleration;
1687 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setInteractive()

void QDeclarativeFlickable::setInteractive ( bool  interactive)

Definition at line 634 of file qdeclarativeflickable.cpp.

635 {
637  if (interactive != d->interactive) {
638  d->interactive = interactive;
639  if (!interactive && (d->hData.flicking || d->vData.flicking)) {
640  d->timeline.clear();
641  d->vTime = d->timeline.time();
642  d->hData.flicking = false;
643  d->vData.flicking = false;
647  emit flickEnded();
648  }
650  }
651 }
QDeclarativeParserStatus ** d
void flickingHorizontallyChanged()
void flickingVerticallyChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setMaximumFlickVelocity()

void QDeclarativeFlickable::setMaximumFlickVelocity ( qreal  v)

Definition at line 1656 of file qdeclarativeflickable.cpp.

1657 {
1659  if (v == d->maxVelocity)
1660  return;
1661  d->maxVelocity = v;
1663 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void maximumFlickVelocityChanged()

◆ setPressDelay()

void QDeclarativeFlickable::setPressDelay ( int  delay)

Definition at line 1741 of file qdeclarativeflickable.cpp.

1742 {
1744  if (d->pressDelay == delay)
1745  return;
1746  d->pressDelay = delay;
1748 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ ticked

void QDeclarativeFlickable::ticked ( )
protectedvirtualslot

Definition at line 712 of file qdeclarativeflickable.cpp.

713 {
714  viewportMoved();
715 }

◆ timerEvent()

void QDeclarativeFlickable::timerEvent ( QTimerEvent event)
protectedvirtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also
startTimer(), killTimer(), event()

Reimplemented from QObject.

Definition at line 1105 of file qdeclarativeflickable.cpp.

1106 {
1108  if (event->timerId() == d->delayedPressTimer.timerId()) {
1109  d->delayedPressTimer.stop();
1110  if (d->delayedPressEvent) {
1112  if (!grabber || grabber != this) {
1113  // We replay the mouse press but the grabber we had might not be interessted by the event (e.g. overlay)
1114  // so we reset the grabber
1115  if (scene()->mouseGrabberItem() == d->delayedPressTarget)
1116  d->delayedPressTarget->ungrabMouse();
1117  //Use the event handler that will take care of finding the proper item to propagate the event
1118  QApplication::postEvent(scene(), d->delayedPressEvent);
1119  } else {
1120  delete d->delayedPressEvent;
1121  }
1122  d->delayedPressEvent = 0;
1123  }
1124  }
1125 }
QDeclarativeParserStatus ** d
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...
T * qobject_cast(QObject *object)
Definition: qobject.h:375
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse...
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
Definition: qcoreevent.h:346
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.

◆ verticalVelocity()

qreal QDeclarativeFlickable::verticalVelocity ( ) const

Referenced by setInteractive(), and viewportMoved().

◆ verticalVelocityChanged

void QDeclarativeFlickable::verticalVelocityChanged ( )
signal

◆ vHeight()

qreal QDeclarativeFlickable::vHeight ( ) const
protected

Definition at line 1507 of file qdeclarativeflickable.cpp.

Referenced by maxYExtent(), and yflick().

1508 {
1509  Q_D(const QDeclarativeFlickable);
1510  if (d->vData.viewSize < 0)
1511  return height();
1512  else
1513  return d->vData.viewSize;
1514 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ viewportMoved()

void QDeclarativeFlickable::viewportMoved ( )
protectedvirtual

Reimplemented in QDeclarativeListView, and QDeclarativeGridView.

Definition at line 1148 of file qdeclarativeflickable.cpp.

Referenced by setContentX(), setContentY(), ticked(), QDeclarativeGridView::viewportMoved(), and QDeclarativeListView::viewportMoved().

1149 {
1151 
1152  qreal prevX = d->lastFlickablePosition.x();
1153  qreal prevY = d->lastFlickablePosition.y();
1154  if (d->pressed || d->calcVelocity) {
1155  int elapsed = QDeclarativeItemPrivate::restart(d->velocityTime);
1156  if (elapsed > 0) {
1157  qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / elapsed;
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);
1162  }
1163  qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / elapsed;
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);
1168  }
1169  }
1170  } else {
1171  if (d->timeline.time() > d->vTime) {
1172  d->velocityTimeline.clear();
1173  qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
1174  qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
1175  d->hData.smoothVelocity.setValue(horizontalVelocity);
1176  d->vData.smoothVelocity.setValue(verticalVelocity);
1177  }
1178  }
1179 
1180  if (!d->vData.inOvershoot && !d->vData.fixingUp && d->vData.flicking
1181  && (d->vData.move.value() > minYExtent() || d->vData.move.value() < maxYExtent())
1182  && qAbs(d->vData.smoothVelocity.value()) > 100) {
1183  // Increase deceleration if we've passed a bound
1184  d->vData.inOvershoot = true;
1185  qreal maxDistance = d->overShootDistance(height());
1186  d->timeline.reset(d->vData.move);
1187  d->timeline.accel(d->vData.move, -d->vData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance);
1188  d->timeline.callback(QDeclarativeTimeLineCallback(&d->vData.move, d->fixupY_callback, d));
1189  }
1190  if (!d->hData.inOvershoot && !d->hData.fixingUp && d->hData.flicking
1191  && (d->hData.move.value() > minXExtent() || d->hData.move.value() < maxXExtent())
1192  && qAbs(d->hData.smoothVelocity.value()) > 100) {
1193  // Increase deceleration if we've passed a bound
1194  d->hData.inOvershoot = true;
1195  qreal maxDistance = d->overShootDistance(width());
1196  d->timeline.reset(d->hData.move);
1197  d->timeline.accel(d->hData.move, -d->hData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance);
1198  d->timeline.callback(QDeclarativeTimeLineCallback(&d->hData.move, d->fixupX_callback, d));
1199  }
1200 
1201  d->lastFlickablePosition = QPointF(d->hData.move.value(), d->vData.move.value());
1202 
1203  d->vTime = d->timeline.time();
1204  d->updateBeginningEnd();
1205 }
double qreal
Definition: qglobal.h:1193
static double elapsed(qint64 after, qint64 before)
QDeclarativeParserStatus ** d
virtual qreal maxYExtent() const
#define QML_FLICK_OVERSHOOTFRICTION
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_D(Class)
Definition: qglobal.h:2482
virtual qreal minYExtent() const
virtual qreal minXExtent() const
static qint64 restart(QElapsedTimer &)
qreal verticalVelocity() const
qreal horizontalVelocity() const
virtual qreal maxXExtent() const

◆ visibleArea()

QDeclarativeFlickableVisibleArea* QDeclarativeFlickable::visibleArea ( )
protected

Referenced by ticked().

◆ vWidth()

qreal QDeclarativeFlickable::vWidth ( ) const
protected

Definition at line 1498 of file qdeclarativeflickable.cpp.

Referenced by maxXExtent(), and xflick().

1499 {
1500  Q_D(const QDeclarativeFlickable);
1501  if (d->hData.viewSize < 0)
1502  return width();
1503  else
1504  return d->hData.viewSize;
1505 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ wheelEvent()

void QDeclarativeFlickable::wheelEvent ( QGraphicsSceneWheelEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive wheel events for this item.

If you reimplement this function, event will be accepted by default.

If you ignore the event, (i.e., by calling QEvent::ignore(),) it will propagate to any item beneath this item. If no items accept the event, it will be ignored by the scene, and propagate to the view (e.g., the view's vertical scroll bar).

The default implementation ignores the event.

See also
sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 996 of file qdeclarativeflickable.cpp.

997 {
999  if (!d->interactive) {
1001  } else if (yflick() && event->orientation() == Qt::Vertical) {
1002  bool valid = false;
1003  if (event->delta() > 0 && contentY() > -minYExtent()) {
1004  d->vData.velocity = qMax(event->delta()*2 - d->vData.smoothVelocity.value(), qreal(d->maxVelocity/4));
1005  valid = true;
1006  } else if (event->delta() < 0 && contentY() < -maxYExtent()) {
1007  d->vData.velocity = qMin(event->delta()*2 - d->vData.smoothVelocity.value(), qreal(-d->maxVelocity/4));
1008  valid = true;
1009  }
1010  if (valid) {
1011  d->vData.flicking = false;
1012  d->flickY(d->vData.velocity);
1013  if (d->vData.flicking) {
1014  d->vMoved = true;
1015  movementStarting();
1016  }
1017  event->accept();
1018  }
1019  } else if (xflick() && event->orientation() == Qt::Horizontal) {
1020  bool valid = false;
1021  if (event->delta() > 0 && contentX() > -minXExtent()) {
1022  d->hData.velocity = qMax(event->delta()*2 - d->hData.smoothVelocity.value(), qreal(d->maxVelocity/4));
1023  valid = true;
1024  } else if (event->delta() < 0 && contentX() < -maxXExtent()) {
1025  d->hData.velocity = qMin(event->delta()*2 - d->hData.smoothVelocity.value(), qreal(-d->maxVelocity/4));
1026  valid = true;
1027  }
1028  if (valid) {
1029  d->hData.flicking = false;
1030  d->flickX(d->hData.velocity);
1031  if (d->hData.flicking) {
1032  d->hMoved = true;
1033  movementStarting();
1034  }
1035  event->accept();
1036  }
1037  } else {
1039  }
1040 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
virtual qreal maxYExtent() const
qreal contentY() const
qreal contentX() const
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
This event handler, for event event, can be reimplemented to receive wheel events for this item...
#define Q_D(Class)
Definition: qglobal.h:2482
virtual qreal minYExtent() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual qreal minXExtent() const
int delta() const
Returns the distance that the wheel is rotated, in eighths (1/8s) of a degree.
Qt::Orientation orientation() const
Returns the wheel orientation.
virtual qreal maxXExtent() const

◆ xflick()

bool QDeclarativeFlickable::xflick ( ) const
protected

◆ yflick()

bool QDeclarativeFlickable::yflick ( ) const
protected

Friends and Related Functions

◆ QDeclarativeFlickableVisibleArea

Definition at line 220 of file qdeclarativeflickable_p.h.

Referenced by ticked().

Properties

◆ atXBeginning

bool QDeclarativeFlickable::atXBeginning
private

Definition at line 84 of file qdeclarativeflickable_p.h.

◆ atXEnd

bool QDeclarativeFlickable::atXEnd
private

Definition at line 82 of file qdeclarativeflickable_p.h.

◆ atYBeginning

bool QDeclarativeFlickable::atYBeginning
private

Definition at line 85 of file qdeclarativeflickable_p.h.

◆ atYEnd

bool QDeclarativeFlickable::atYEnd
private

Definition at line 83 of file qdeclarativeflickable_p.h.

◆ boundsBehavior

QDeclarativeFlickable::BoundsBehavior QDeclarativeFlickable::boundsBehavior
private

Definition at line 68 of file qdeclarativeflickable_p.h.

◆ contentHeight

qreal QDeclarativeFlickable::contentHeight
private

Definition at line 60 of file qdeclarativeflickable_p.h.

◆ contentItem

QDeclarativeItem * QDeclarativeFlickable::contentItem
private

Definition at line 63 of file qdeclarativeflickable_p.h.

◆ contentWidth

qreal QDeclarativeFlickable::contentWidth
private

Definition at line 59 of file qdeclarativeflickable_p.h.

◆ contentX

qreal QDeclarativeFlickable::contentX
private

Definition at line 61 of file qdeclarativeflickable_p.h.

◆ contentY

qreal QDeclarativeFlickable::contentY
private

Definition at line 62 of file qdeclarativeflickable_p.h.

◆ flickableChildren

QDeclarativeListProperty< QGraphicsObject > QDeclarativeFlickable::flickableChildren
private

Definition at line 90 of file qdeclarativeflickable_p.h.

◆ flickableData

QDeclarativeListProperty< QObject > QDeclarativeFlickable::flickableData
private

Definition at line 89 of file qdeclarativeflickable_p.h.

◆ flickableDirection

QDeclarativeFlickable::FlickableDirection QDeclarativeFlickable::flickableDirection
private

Definition at line 77 of file qdeclarativeflickable_p.h.

◆ flickDeceleration

qreal QDeclarativeFlickable::flickDeceleration
private

Definition at line 70 of file qdeclarativeflickable_p.h.

◆ flicking

bool QDeclarativeFlickable::flicking
private

Definition at line 74 of file qdeclarativeflickable_p.h.

◆ flickingHorizontally

bool QDeclarativeFlickable::flickingHorizontally
private

Definition at line 75 of file qdeclarativeflickable_p.h.

◆ flickingVertically

bool QDeclarativeFlickable::flickingVertically
private

Definition at line 76 of file qdeclarativeflickable_p.h.

◆ horizontalVelocity

qreal QDeclarativeFlickable::horizontalVelocity
private

Definition at line 65 of file qdeclarativeflickable_p.h.

◆ interactive

bool QDeclarativeFlickable::interactive
private

◆ maximumFlickVelocity

qreal QDeclarativeFlickable::maximumFlickVelocity
private

Definition at line 69 of file qdeclarativeflickable_p.h.

◆ moving

bool QDeclarativeFlickable::moving
private

Definition at line 71 of file qdeclarativeflickable_p.h.

◆ movingHorizontally

bool QDeclarativeFlickable::movingHorizontally
private

Definition at line 72 of file qdeclarativeflickable_p.h.

◆ movingVertically

bool QDeclarativeFlickable::movingVertically
private

Definition at line 73 of file qdeclarativeflickable_p.h.

◆ pressDelay

int QDeclarativeFlickable::pressDelay
private

◆ verticalVelocity

qreal QDeclarativeFlickable::verticalVelocity
private

Definition at line 66 of file qdeclarativeflickable_p.h.

◆ visibleArea

QDeclarativeFlickableVisibleArea * QDeclarativeFlickable::visibleArea
private

Definition at line 87 of file qdeclarativeflickable_p.h.


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