Qt 4.8
Public Types | Public Slots | Signals | Public Functions | Static Public Functions | Protected Functions | Private Slots | Properties | List of all members
QDeclarativeListView Class Reference

#include <qdeclarativelistview_p.h>

Inheritance diagram for QDeclarativeListView:
QDeclarativeFlickable QDeclarativeItem QGraphicsObject QDeclarativeParserStatus QObject QGraphicsItem

Public Types

enum  HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange }
 
enum  Orientation { Horizontal = Qt::Horizontal, Vertical = Qt::Vertical }
 
enum  PositionMode {
  Beginning, Center, End, Visible,
  Contain
}
 
enum  SnapMode { NoSnap, SnapToItem, SnapOneItem }
 
- Public Types inherited from QDeclarativeFlickable
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...
 

Public Slots

void decrementCurrentIndex ()
 
void incrementCurrentIndex ()
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Signals

void cacheBufferChanged ()
 
void countChanged ()
 
void currentIndexChanged ()
 
void currentSectionChanged ()
 
void delegateChanged ()
 
void footerChanged ()
 
void headerChanged ()
 
void highlightChanged ()
 
void highlightFollowsCurrentItemChanged ()
 
void highlightItemChanged ()
 
void highlightMoveDurationChanged ()
 
void highlightMoveSpeedChanged ()
 
void highlightRangeModeChanged ()
 
void highlightResizeDurationChanged ()
 
void highlightResizeSpeedChanged ()
 
void keyNavigationWrapsChanged ()
 
void layoutDirectionChanged ()
 
void modelChanged ()
 
void orientationChanged ()
 
void preferredHighlightBeginChanged ()
 
void preferredHighlightEndChanged ()
 
void snapModeChanged ()
 
void spacingChanged ()
 
- Signals inherited from QDeclarativeFlickable
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

int cacheBuffer () const
 
int count () const
 
int currentIndex () const
 
QDeclarativeItemcurrentItem ()
 
QString currentSection () const
 
QDeclarativeComponentdelegate () const
 
Qt::LayoutDirection effectiveLayoutDirection () const
 
QDeclarativeComponentfooter () const
 
QDeclarativeComponentheader () const
 
QDeclarativeComponenthighlight () const
 
bool highlightFollowsCurrentItem () const
 
QDeclarativeItemhighlightItem ()
 
int highlightMoveDuration () const
 
qreal highlightMoveSpeed () const
 
HighlightRangeMode highlightRangeMode () const
 
int highlightResizeDuration () const
 
qreal highlightResizeSpeed () const
 
Q_INVOKABLE int indexAt (qreal x, qreal y) const
 
bool isWrapEnabled () const
 
Qt::LayoutDirection layoutDirection () const
 
QVariant model () const
 
Orientation orientation () const
 
Q_INVOKABLE void positionViewAtBeginning ()
 
Q_INVOKABLE void positionViewAtEnd ()
 
Q_INVOKABLE void positionViewAtIndex (int index, int mode)
 
qreal preferredHighlightBegin () const
 
qreal preferredHighlightEnd () const
 
 QDeclarativeListView (QDeclarativeItem *parent=0)
 
void resetPreferredHighlightBegin ()
 
void resetPreferredHighlightEnd ()
 
QDeclarativeViewSectionsectionCriteria ()
 
void setCacheBuffer (int)
 
virtual void setContentX (qreal pos)
 
virtual void setContentY (qreal pos)
 
void setCurrentIndex (int idx)
 
void setDelegate (QDeclarativeComponent *)
 
void setFooter (QDeclarativeComponent *)
 
void setHeader (QDeclarativeComponent *)
 
void setHighlight (QDeclarativeComponent *highlight)
 
void setHighlightFollowsCurrentItem (bool)
 
void setHighlightMoveDuration (int)
 
void setHighlightMoveSpeed (qreal)
 
void setHighlightRangeMode (HighlightRangeMode mode)
 
void setHighlightResizeDuration (int)
 
void setHighlightResizeSpeed (qreal)
 
void setLayoutDirection (Qt::LayoutDirection)
 
void setModel (const QVariant &)
 
void setOrientation (Orientation)
 
void setPreferredHighlightBegin (qreal)
 
void setPreferredHighlightEnd (qreal)
 
void setSnapMode (SnapMode mode)
 
void setSpacing (qreal spacing)
 
void setWrapEnabled (bool)
 
SnapMode snapMode () const
 
qreal spacing () const
 
 ~QDeclarativeListView ()
 
- Public Functions inherited from QDeclarativeFlickable
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)
 
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 ()
 

Static Public Functions

static QDeclarativeListViewAttachedqmlAttachedProperties (QObject *)
 
- 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)
 

Protected Functions

virtual void componentComplete ()
 
virtual bool event (QEvent *event)
 
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 void keyPressEvent (QKeyEvent *)
 
virtual qreal maxXExtent () const
 
virtual qreal maxYExtent () const
 
virtual qreal minXExtent () const
 
virtual qreal minYExtent () const
 
virtual void viewportMoved ()
 
- Protected Functions inherited from QDeclarativeFlickable
void cancelFlick ()
 
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
 
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 ()
 
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...
 
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...
 

Private Slots

void animStopped ()
 
void createdItem (int index, QDeclarativeItem *item)
 
void destroyingItem (QDeclarativeItem *item)
 
void destroyRemoved ()
 
void itemsChanged (int index, int count)
 
void itemsInserted (int index, int count)
 
void itemsMoved (int from, int to, int count)
 
void itemsRemoved (int index, int count)
 
void modelReset ()
 
void refill ()
 
void trackedPositionChanged ()
 
void updateSections ()
 

Properties

int cacheBuffer
 
int count
 
int currentIndex
 
QDeclarativeItemcurrentItem
 
QString currentSection
 
QDeclarativeComponentdelegate
 
QDeclarativeComponentfooter
 
QDeclarativeComponentheader
 
QDeclarativeComponenthighlight
 
bool highlightFollowsCurrentItem
 
QDeclarativeItemhighlightItem
 
int highlightMoveDuration
 
qreal highlightMoveSpeed
 
HighlightRangeMode highlightRangeMode
 
int highlightResizeDuration
 
qreal highlightResizeSpeed
 
bool keyNavigationWraps
 
Qt::LayoutDirection layoutDirection
 
QVariant model
 
Orientation orientation
 
qreal preferredHighlightBegin
 
qreal preferredHighlightEnd
 
QDeclarativeViewSectionsection
 
SnapMode snapMode
 
qreal spacing
 

Additional Inherited Members

- 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 Slots inherited from QDeclarativeFlickable
void movementEnding ()
 
void movementStarting ()
 
virtual void ticked ()
 
- Protected Slots inherited from QGraphicsObject
void updateMicroFocus ()
 Updates the item's micro focus. 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 91 of file qdeclarativelistview_p.h.

Enumerations

◆ HighlightRangeMode

◆ Orientation

◆ PositionMode

◆ SnapMode

Constructors and Destructors

◆ QDeclarativeListView()

QDeclarativeListView::QDeclarativeListView ( QDeclarativeItem parent = 0)

Definition at line 1630 of file qdeclarativelistview.cpp.

1632 {
1634  d->init();
1635 }
QDeclarativeParserStatus ** d
QDeclarativeFlickable(QDeclarativeItem *parent=0)
#define Q_D(Class)
Definition: qglobal.h:2482

◆ ~QDeclarativeListView()

QDeclarativeListView::~QDeclarativeListView ( )

Definition at line 1637 of file qdeclarativelistview.cpp.

1638 {
1640  d->clear();
1641  if (d->ownModel)
1642  delete d->model;
1643  delete d->header;
1644  delete d->footer;
1645 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

Functions

◆ animStopped

void QDeclarativeListView::animStopped ( )
privateslot

Definition at line 3731 of file qdeclarativelistview.cpp.

3732 {
3735  if (d->haveHighlightRange && d->highlightRange == QDeclarativeListView::StrictlyEnforceRange)
3736  d->updateHighlight();
3737 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ cacheBuffer()

int QDeclarativeListView::cacheBuffer ( ) const

Referenced by setWrapEnabled().

◆ cacheBufferChanged

void QDeclarativeListView::cacheBufferChanged ( )
signal

Referenced by setCacheBuffer().

◆ componentComplete()

void QDeclarativeListView::componentComplete ( )
protectedvirtual
Warning
This function is not part of the public interface.

componentComplete() is called when all items in the component have been constructed. It is often desirable to delay some processing until the component is complete an all bindings in the component have been resolved.

Reimplemented from QDeclarativeItem.

Definition at line 3191 of file qdeclarativelistview.cpp.

3192 {
3195  updateSections();
3196  d->updateHeader();
3197  d->updateFooter();
3198  if (d->isValid()) {
3199  refill();
3201  if (d->currentIndex < 0 && !d->currentIndexCleared)
3202  d->updateCurrent(0);
3203  else
3204  d->updateCurrent(d->currentIndex);
3205  if (d->highlight && d->currentItem) {
3206  if (d->autoHighlight)
3207  d->highlight->setPosition(d->currentItem->position());
3208  d->updateTrackedItem();
3209  }
3210  d->moveReason = QDeclarativeListViewPrivate::Other;
3211  d->fixupPosition();
3212  }
3213 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()

◆ count()

int QDeclarativeListView::count ( ) const

◆ countChanged

void QDeclarativeListView::countChanged ( )
signal

◆ createdItem

void QDeclarativeListView::createdItem ( int  index,
QDeclarativeItem item 
)
privateslot

Definition at line 3708 of file qdeclarativelistview.cpp.

Referenced by setModel().

3709 {
3711  if (d->requestedIndex != index) {
3712  item->setParentItem(contentItem());
3713  d->unrequestedItems.insert(item, index);
3714  if (d->orient == QDeclarativeListView::Vertical) {
3715  item->setY(d->positionAt(index));
3716  } else {
3717  if (d->isRightToLeft())
3718  item->setX(-d->positionAt(index)-item->width());
3719  else
3720  item->setX(d->positionAt(index));
3721  }
3722  }
3723 }
QDeclarativeParserStatus ** d
QDeclarativeItem * contentItem()
#define Q_D(Class)
Definition: qglobal.h:2482
void setParentItem(QDeclarativeItem *parent)
void setX(qreal x)
Set&#39;s the x coordinate of the item&#39;s position.
void setY(qreal y)
Set&#39;s the y coordinate of the item&#39;s position.
quint16 index

◆ currentIndex()

int QDeclarativeListView::currentIndex ( ) const

◆ currentIndexChanged

void QDeclarativeListView::currentIndexChanged ( )
signal

◆ currentItem()

QDeclarativeItem* QDeclarativeListView::currentItem ( )

◆ currentSection()

QString QDeclarativeListView::currentSection ( ) const

Referenced by sectionCriteria().

◆ currentSectionChanged

void QDeclarativeListView::currentSectionChanged ( )
signal

◆ decrementCurrentIndex

void QDeclarativeListView::decrementCurrentIndex ( )
slot

Definition at line 2988 of file qdeclarativelistview.cpp.

Referenced by keyPressEvent().

2989 {
2991  int count = d->model ? d->model->count() : 0;
2992  if (count && (currentIndex() > 0 || d->wrap)) {
2994  int index = currentIndex()-1;
2995  setCurrentIndex((index >= 0 && index < count) ? index : count-1);
2996  }
2997 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
quint16 index

◆ delegate()

QDeclarativeComponent* QDeclarativeListView::delegate ( ) const

Referenced by setDelegate(), and setModel().

◆ delegateChanged

void QDeclarativeListView::delegateChanged ( )
signal

Referenced by setDelegate().

◆ destroyingItem

void QDeclarativeListView::destroyingItem ( QDeclarativeItem item)
privateslot

Definition at line 3725 of file qdeclarativelistview.cpp.

Referenced by setModel().

3726 {
3728  d->unrequestedItems.remove(item);
3729 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ destroyRemoved

void QDeclarativeListView::destroyRemoved ( )
privateslot

Definition at line 3558 of file qdeclarativelistview.cpp.

Referenced by itemsRemoved().

3559 {
3561  for (QList<FxListItem*>::Iterator it = d->visibleItems.begin();
3562  it != d->visibleItems.end();) {
3563  FxListItem *listItem = *it;
3564  if (listItem->index == -1 && listItem->attached->delayRemove() == false) {
3565  d->releaseItem(listItem);
3566  it = d->visibleItems.erase(it);
3567  } else {
3568  ++it;
3569  }
3570  }
3571 
3572  // Correct the positioning of the items
3573  d->updateSections();
3574  d->layout();
3575 }
QDeclarativeParserStatus ** d
#define it(className, varName)
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeListViewAttached * attached
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181

◆ effectiveLayoutDirection()

Qt::LayoutDirection QDeclarativeListView::effectiveLayoutDirection ( ) const

Definition at line 2279 of file qdeclarativelistview.cpp.

2280 {
2281  Q_D(const QDeclarativeListView);
2282  if (d->effectiveLayoutMirror)
2283  return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
2284  else
2285  return d->layoutDirection;
2286 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ event()

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

Reimplemented from QDeclarativeItem.

Definition at line 2662 of file qdeclarativelistview.cpp.

2663 {
2665  if (event->type() == QEvent::User) {
2666  if (d->layoutScheduled)
2667  d->layout();
2668  return true;
2669  }
2670 
2672 }
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
virtual bool event(QEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482

◆ footer()

QDeclarativeComponent* QDeclarativeListView::footer ( ) const

◆ footerChanged

void QDeclarativeListView::footerChanged ( )
signal

Referenced by setFooter().

◆ geometryChanged()

void QDeclarativeListView::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 QDeclarativeFlickable.

Definition at line 2938 of file qdeclarativelistview.cpp.

2940 {
2942  d->maxExtentDirty = true;
2943  d->minExtentDirty = true;
2944  if (d->isRightToLeft() && d->orient == QDeclarativeListView::Horizontal) {
2945  // maintain position relative to the right edge
2946  int dx = newGeometry.width() - oldGeometry.width();
2947  setContentX(contentX() - dx);
2948  }
2949  QDeclarativeFlickable::geometryChanged(newGeometry, oldGeometry);
2950 }
QDeclarativeParserStatus ** d
qreal contentX() const
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void setContentX(qreal pos)
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...

◆ header()

QDeclarativeComponent* QDeclarativeListView::header ( ) const

◆ headerChanged

void QDeclarativeListView::headerChanged ( )
signal

Referenced by setHeader().

◆ highlight()

QDeclarativeComponent* QDeclarativeListView::highlight ( ) const

◆ highlightChanged

void QDeclarativeListView::highlightChanged ( )
signal

Referenced by setHighlight().

◆ highlightFollowsCurrentItem()

bool QDeclarativeListView::highlightFollowsCurrentItem ( ) const

Referenced by setHighlight().

◆ highlightFollowsCurrentItemChanged

void QDeclarativeListView::highlightFollowsCurrentItemChanged ( )
signal

◆ highlightItem()

QDeclarativeItem* QDeclarativeListView::highlightItem ( )

Referenced by setCurrentIndex().

◆ highlightItemChanged

void QDeclarativeListView::highlightItemChanged ( )
signal

◆ highlightMoveDuration()

int QDeclarativeListView::highlightMoveDuration ( ) const

Referenced by setHighlightMoveSpeed().

◆ highlightMoveDurationChanged

void QDeclarativeListView::highlightMoveDurationChanged ( )
signal

◆ highlightMoveSpeed()

qreal QDeclarativeListView::highlightMoveSpeed ( ) const

Referenced by sectionCriteria().

◆ highlightMoveSpeedChanged

void QDeclarativeListView::highlightMoveSpeedChanged ( )
signal

Referenced by setHighlightMoveSpeed().

◆ highlightRangeMode()

HighlightRangeMode QDeclarativeListView::highlightRangeMode ( ) const

◆ highlightRangeModeChanged

void QDeclarativeListView::highlightRangeModeChanged ( )
signal

Referenced by setHighlightRangeMode().

◆ highlightResizeDuration()

int QDeclarativeListView::highlightResizeDuration ( ) const

Referenced by setHighlightResizeSpeed().

◆ highlightResizeDurationChanged

void QDeclarativeListView::highlightResizeDurationChanged ( )
signal

◆ highlightResizeSpeed()

qreal QDeclarativeListView::highlightResizeSpeed ( ) const

◆ highlightResizeSpeedChanged

void QDeclarativeListView::highlightResizeSpeedChanged ( )
signal

Referenced by setHighlightResizeSpeed().

◆ incrementCurrentIndex

void QDeclarativeListView::incrementCurrentIndex ( )
slot

Definition at line 2965 of file qdeclarativelistview.cpp.

Referenced by keyPressEvent().

2966 {
2968  int count = d->model ? d->model->count() : 0;
2969  if (count && (currentIndex() < count - 1 || d->wrap)) {
2971  int index = currentIndex()+1;
2972  setCurrentIndex((index >= 0 && index < count) ? index : 0);
2973  }
2974 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
quint16 index

◆ indexAt()

int QDeclarativeListView::indexAt ( qreal  x,
qreal  y 
) const

Definition at line 3179 of file qdeclarativelistview.cpp.

3180 {
3181  Q_D(const QDeclarativeListView);
3182  for (int i = 0; i < d->visibleItems.count(); ++i) {
3183  const FxListItem *listItem = d->visibleItems.at(i);
3184  if(listItem->contains(x, y))
3185  return listItem->index;
3186  }
3187 
3188  return -1;
3189 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
bool contains(qreal x, qreal y) const
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().

◆ isWrapEnabled()

bool QDeclarativeListView::isWrapEnabled ( ) const

Definition at line 2301 of file qdeclarativelistview.cpp.

2302 {
2303  Q_D(const QDeclarativeListView);
2304  return d->wrap;
2305 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ itemsChanged

void QDeclarativeListView::itemsChanged ( int  index,
int  count 
)
privateslot

Definition at line 3687 of file qdeclarativelistview.cpp.

Referenced by setModel().

3688 {
3690  d->updateSections();
3691  d->layout();
3692 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ itemsInserted

void QDeclarativeListView::itemsInserted ( int  index,
int  count 
)
privateslot

Definition at line 3309 of file qdeclarativelistview.cpp.

Referenced by setModel().

3310 {
3312  if (!isComponentComplete())
3313  return;
3314  d->updateUnrequestedIndexes();
3315  d->moveReason = QDeclarativeListViewPrivate::Other;
3316 
3317  qreal tempPos = d->isRightToLeft() ? -d->position()-d->size() : d->position();
3318  int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
3319 
3320  if (index < 0) {
3321  int i = d->visibleItems.count() - 1;
3322  while (i > 0 && d->visibleItems.at(i)->index == -1)
3323  --i;
3324  if (i == 0 && d->visibleItems.first()->index == -1) {
3325  // there are no visible items except items marked for removal
3326  index = d->visibleItems.count();
3327  } else if (d->visibleItems.at(i)->index + 1 == modelIndex
3328  && d->visibleItems.at(i)->endPosition() < d->buffer+tempPos+d->size()-1) {
3329  // Special case of appending an item to the model.
3330  index = d->visibleItems.count();
3331  } else {
3332  if (modelIndex < d->visibleIndex) {
3333  // Insert before visible items
3334  d->visibleIndex += count;
3335  for (int i = 0; i < d->visibleItems.count(); ++i) {
3336  FxListItem *listItem = d->visibleItems.at(i);
3337  if (listItem->index != -1 && listItem->index >= modelIndex)
3338  listItem->index += count;
3339  }
3340  }
3341  if (d->currentIndex >= modelIndex) {
3342  // adjust current item index
3343  d->currentIndex += count;
3344  if (d->currentItem)
3345  d->currentItem->index = d->currentIndex;
3347  }
3348  d->scheduleLayout();
3349  d->itemCount += count;
3350  emit countChanged();
3351  return;
3352  }
3353  }
3354 
3355  // index can be the next item past the end of the visible items list (i.e. appended)
3356  int pos = 0;
3357  if (d->visibleItems.count()) {
3358  pos = index < d->visibleItems.count() ? d->visibleItems.at(index)->position()
3359  : d->visibleItems.last()->endPosition()+d->spacing+1;
3360  } else if (d->itemCount == 0 && d->header) {
3361  pos = d->header->size();
3362  }
3363 
3364  int initialPos = pos;
3365  int diff = 0;
3366  QList<FxListItem*> added;
3367  bool addedVisible = false;
3368  FxListItem *firstVisible = d->firstVisibleItem();
3369  if (firstVisible && pos < firstVisible->position()) {
3370  // Insert items before the visible item.
3371  int insertionIdx = index;
3372  int i = 0;
3373  int from = tempPos - d->buffer;
3374  for (i = count-1; i >= 0 && pos > from; --i) {
3375  if (!addedVisible) {
3376  d->scheduleLayout();
3377  addedVisible = true;
3378  }
3379  FxListItem *item = d->createItem(modelIndex + i);
3380  if (!item) {
3381  // broken or no delegate
3382  d->clear();
3383  return;
3384  }
3385  d->visibleItems.insert(insertionIdx, item);
3386  pos -= item->size() + d->spacing;
3387  item->setPosition(pos);
3388  index++;
3389  }
3390  if (i >= 0) {
3391  // If we didn't insert all our new items - anything
3392  // before the current index is not visible - remove it.
3393  while (insertionIdx--) {
3394  FxListItem *item = d->visibleItems.takeFirst();
3395  if (item->index != -1)
3396  d->visibleIndex++;
3397  d->releaseItem(item);
3398  }
3399  } else {
3400  // adjust pos of items before inserted items.
3401  for (int i = insertionIdx-1; i >= 0; i--) {
3402  FxListItem *listItem = d->visibleItems.at(i);
3403  listItem->setPosition(listItem->position() - (initialPos - pos));
3404  }
3405  }
3406  } else {
3407  int i = 0;
3408  int to = d->buffer+tempPos+d->size()-1;
3409  for (i = 0; i < count && pos <= to; ++i) {
3410  if (!addedVisible) {
3411  d->scheduleLayout();
3412  addedVisible = true;
3413  }
3414  FxListItem *item = d->createItem(modelIndex + i);
3415  if (!item) {
3416  // broken or no delegate
3417  d->clear();
3418  return;
3419  }
3420  d->visibleItems.insert(index, item);
3421  item->setPosition(pos);
3422  added.append(item);
3423  pos += item->size() + d->spacing;
3424  ++index;
3425  }
3426  if (i != count) {
3427  // We didn't insert all our new items, which means anything
3428  // beyond the current index is not visible - remove it.
3429  while (d->visibleItems.count() > index)
3430  d->releaseItem(d->visibleItems.takeLast());
3431  }
3432  diff = pos - initialPos;
3433  }
3434  if (d->itemCount && d->currentIndex >= modelIndex) {
3435  // adjust current item index
3436  d->currentIndex += count;
3437  if (d->currentItem) {
3438  d->currentItem->index = d->currentIndex;
3439  d->currentItem->setPosition(d->currentItem->position() + diff);
3440  }
3442  } else if (!d->itemCount && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
3443  d->updateCurrent(0);
3444  }
3445  // Update the indexes of the following visible items.
3446  for (; index < d->visibleItems.count(); ++index) {
3447  FxListItem *listItem = d->visibleItems.at(index);
3448  if (d->currentItem && listItem->item != d->currentItem->item)
3449  listItem->setPosition(listItem->position() + diff);
3450  if (listItem->index != -1)
3451  listItem->index += count;
3452  }
3453  // everything is in order now - emit add() signal
3454  for (int j = 0; j < added.count(); ++j)
3455  added.at(j)->attached->emitAdd();
3456 
3457  d->updateSections();
3458  d->itemCount += count;
3459  emit countChanged();
3460 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
QPointF pos() const
Returns the position of the item in parent coordinates.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_D(Class)
Definition: qglobal.h:2482
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QDeclarativeItem * item
QDeclarativeListViewAttached * attached
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
static Bigint * diff(Bigint *a, Bigint *b)
qreal position() const
void setPosition(qreal pos)
quint16 index
qreal size() const
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ itemsMoved

void QDeclarativeListView::itemsMoved ( int  from,
int  to,
int  count 
)
privateslot

Definition at line 3577 of file qdeclarativelistview.cpp.

Referenced by setModel().

3578 {
3580  if (!isComponentComplete())
3581  return;
3582  d->updateUnrequestedIndexes();
3583 
3584  if (d->visibleItems.isEmpty()) {
3585  refill();
3586  return;
3587  }
3588 
3589  d->moveReason = QDeclarativeListViewPrivate::Other;
3590  FxListItem *firstVisible = d->firstVisibleItem();
3591  qreal firstItemPos = firstVisible->position();
3592  QHash<int,FxListItem*> moved;
3593  int moveBy = 0;
3594 
3595  QList<FxListItem*>::Iterator it = d->visibleItems.begin();
3596  while (it != d->visibleItems.end()) {
3597  FxListItem *item = *it;
3598  if (item->index >= from && item->index < from + count) {
3599  // take the items that are moving
3600  item->index += (to-from);
3601  moved.insert(item->index, item);
3602  if (item->position() < firstItemPos)
3603  moveBy += item->size();
3604  it = d->visibleItems.erase(it);
3605  } else {
3606  // move everything after the moved items.
3607  if (item->index > from && item->index != -1)
3608  item->index -= count;
3609  ++it;
3610  }
3611  }
3612 
3613  int remaining = count;
3614  int endIndex = d->visibleIndex;
3615  it = d->visibleItems.begin();
3616  while (it != d->visibleItems.end()) {
3617  FxListItem *item = *it;
3618  if (remaining && item->index >= to && item->index < to + count) {
3619  // place items in the target position, reusing any existing items
3620  FxListItem *movedItem = moved.take(item->index);
3621  if (!movedItem)
3622  movedItem = d->createItem(item->index);
3623  if (!movedItem) {
3624  // broken or no delegate
3625  d->clear();
3626  return;
3627  }
3628  if (item->index <= firstVisible->index)
3629  moveBy -= movedItem->size();
3630  it = d->visibleItems.insert(it, movedItem);
3631  ++it;
3632  --remaining;
3633  } else {
3634  if (item->index != -1) {
3635  if (item->index >= to) {
3636  // update everything after the moved items.
3637  item->index += count;
3638  }
3639  endIndex = item->index;
3640  }
3641  ++it;
3642  }
3643  }
3644 
3645  // If we have moved items to the end of the visible items
3646  // then add any existing moved items that we have
3647  while (FxListItem *item = moved.take(endIndex+1)) {
3648  d->visibleItems.append(item);
3649  ++endIndex;
3650  }
3651 
3652  // update visibleIndex
3653  for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
3654  if ((*it)->index != -1) {
3655  d->visibleIndex = (*it)->index;
3656  break;
3657  }
3658  }
3659 
3660  // Fix current index
3661  if (d->currentIndex >= 0 && d->currentItem) {
3662  int oldCurrent = d->currentIndex;
3663  d->currentIndex = d->model->indexOf(d->currentItem->item, this);
3664  if (oldCurrent != d->currentIndex) {
3665  d->currentItem->index = d->currentIndex;
3667  }
3668  }
3669 
3670  // Whatever moved items remain are no longer visible items.
3671  while (moved.count()) {
3672  int idx = moved.begin().key();
3673  FxListItem *item = moved.take(idx);
3674  if (d->currentItem && item->item == d->currentItem->item)
3675  item->setPosition(d->positionAt(idx));
3676  d->releaseItem(item);
3677  }
3678 
3679  // Ensure we don't cause an ugly list scroll.
3680  if (!d->visibleItems.isEmpty())
3681  d->visibleItems.first()->setPosition(d->visibleItems.first()->position() + moveBy);
3682 
3683  d->updateSections();
3684  d->layout();
3685 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
#define it(className, varName)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it...
Definition: qhash.h:807
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_D(Class)
Definition: qglobal.h:2482
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
QDeclarativeItem * item
#define emit
Definition: qobjectdefs.h:76
void moveBy(qreal dx, qreal dy)
Moves the item by dx points horizontally, and dy point vertically.
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181
qreal position() const
void setPosition(qreal pos)
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
int count(const Key &key) const
Returns the number of items associated with the key.
Definition: qhash.h:719
qreal size() const

◆ itemsRemoved

void QDeclarativeListView::itemsRemoved ( int  index,
int  count 
)
privateslot

Definition at line 3462 of file qdeclarativelistview.cpp.

Referenced by setModel().

3463 {
3465  if (!isComponentComplete())
3466  return;
3467  d->moveReason = QDeclarativeListViewPrivate::Other;
3468  d->updateUnrequestedIndexes();
3469  d->itemCount -= count;
3470 
3471  FxListItem *firstVisible = d->firstVisibleItem();
3472  int preRemovedSize = 0;
3473  bool removedVisible = false;
3474  // Remove the items from the visible list, skipping anything already marked for removal
3475  QList<FxListItem*>::Iterator it = d->visibleItems.begin();
3476  while (it != d->visibleItems.end()) {
3477  FxListItem *item = *it;
3478  if (item->index == -1 || item->index < modelIndex) {
3479  // already removed, or before removed items
3480  ++it;
3481  } else if (item->index >= modelIndex + count) {
3482  // after removed items
3483  item->index -= count;
3484  ++it;
3485  } else {
3486  // removed item
3487  if (!removedVisible) {
3488  d->scheduleLayout();
3489  removedVisible = true;
3490  }
3491  item->attached->emitRemove();
3492  if (item->attached->delayRemove()) {
3493  item->index = -1;
3494  connect(item->attached, SIGNAL(delayRemoveChanged()), this, SLOT(destroyRemoved()), Qt::QueuedConnection);
3495  ++it;
3496  } else {
3497  if (item == firstVisible)
3498  firstVisible = 0;
3499  if (firstVisible && item->position() < firstVisible->position())
3500  preRemovedSize += item->size();
3501  it = d->visibleItems.erase(it);
3502  d->releaseItem(item);
3503  }
3504  }
3505  }
3506 
3507  if (firstVisible && d->visibleItems.first() != firstVisible)
3508  d->visibleItems.first()->setPosition(d->visibleItems.first()->position() + preRemovedSize);
3509 
3510  // fix current
3511  if (d->currentIndex >= modelIndex + count) {
3512  d->currentIndex -= count;
3513  if (d->currentItem)
3514  d->currentItem->index -= count;
3516  } else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) {
3517  // current item has been removed.
3518  d->currentItem->attached->setIsCurrentItem(false);
3519  d->releaseItem(d->currentItem);
3520  d->currentItem = 0;
3521  d->currentIndex = -1;
3522  if (d->itemCount)
3523  d->updateCurrent(qMin(modelIndex, d->itemCount-1));
3524  else
3526  }
3527 
3528  // update visibleIndex
3529  bool haveVisibleIndex = false;
3530  for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
3531  if ((*it)->index != -1) {
3532  d->visibleIndex = (*it)->index;
3533  haveVisibleIndex = true;
3534  break;
3535  }
3536  }
3537 
3538  if (!haveVisibleIndex) {
3539  d->timeline.clear();
3540  if (removedVisible && d->itemCount == 0) {
3541  d->visibleIndex = 0;
3542  d->visiblePos = d->header ? d->header->size() : 0;
3543  d->setPosition(0);
3544  d->updateHeader();
3545  d->updateFooter();
3546  update();
3547  } else {
3548  if (modelIndex < d->visibleIndex)
3549  d->visibleIndex = modelIndex+1;
3550  d->visibleIndex = qMax(qMin(d->visibleIndex, d->itemCount-1), 0);
3551  }
3552  }
3553 
3554  d->updateSections();
3555  emit countChanged();
3556 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
#define it(className, varName)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define SLOT(a)
Definition: qobjectdefs.h:226
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define SIGNAL(a)
Definition: qobjectdefs.h:227
QDeclarativeListViewAttached * attached
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 rece...
Definition: qobject.cpp:2580
#define emit
Definition: qobjectdefs.h:76
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
Definition: qlist.h:181
qreal position() const
qreal size() const

◆ keyNavigationWrapsChanged

void QDeclarativeListView::keyNavigationWrapsChanged ( )
signal

Referenced by setWrapEnabled().

◆ keyPressEvent()

void QDeclarativeListView::keyPressEvent ( QKeyEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativeItem.

Definition at line 2902 of file qdeclarativelistview.cpp.

2903 {
2905  keyPressPreHandler(event);
2906  if (event->isAccepted())
2907  return;
2908 
2909  if (d->model && d->model->count() && d->interactive) {
2910  if ((d->orient == QDeclarativeListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Left)
2911  || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Right)
2912  || (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Up)) {
2913  if (currentIndex() > 0 || (d->wrap && !event->isAutoRepeat())) {
2915  event->accept();
2916  return;
2917  } else if (d->wrap) {
2918  event->accept();
2919  return;
2920  }
2921  } else if ((d->orient == QDeclarativeListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Right)
2922  || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Left)
2923  || (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Down)) {
2924  if (currentIndex() < d->model->count() - 1 || (d->wrap && !event->isAutoRepeat())) {
2926  event->accept();
2927  return;
2928  } else if (d->wrap) {
2929  event->accept();
2930  return;
2931  }
2932  }
2933  }
2934  event->ignore();
2936 }
QDeclarativeParserStatus ** d
virtual void keyPressEvent(QKeyEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482
int currentIndex() const
int key() const
Returns the code of the key that was pressed or released.
Definition: qevent.h:231
bool isAccepted() const
Definition: qcoreevent.h:307
void keyPressPreHandler(QKeyEvent *)

◆ layoutDirection()

Qt::LayoutDirection QDeclarativeListView::layoutDirection ( ) const

◆ layoutDirectionChanged

void QDeclarativeListView::layoutDirectionChanged ( )
signal

Referenced by setLayoutDirection().

◆ maxXExtent()

qreal QDeclarativeListView::maxXExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2853 of file qdeclarativelistview.cpp.

Referenced by minXExtent(), and viewportMoved().

2854 {
2855  Q_D(const QDeclarativeListView);
2856  if (d->orient == QDeclarativeListView::Vertical)
2857  return width();
2858  if (d->maxExtentDirty) {
2859  qreal highlightStart;
2860  qreal highlightEnd;
2861  qreal lastItemPosition = 0;
2862  d->maxExtent = 0;
2863  if (d->isRightToLeft()) {
2864  highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
2865  highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
2866  lastItemPosition = d->endPosition();
2867  } else {
2868  highlightStart = d->highlightRangeStart;
2869  highlightEnd = d->highlightRangeEnd;
2870  if (d->model && d->model->count())
2871  lastItemPosition = d->positionAt(d->model->count()-1);
2872  }
2873  if (!d->model || !d->model->count()) {
2874  if (!d->isRightToLeft())
2875  d->maxExtent = d->header ? -d->header->size() : 0;
2876  d->maxExtent += width();
2877  } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2878  d->maxExtent = -(lastItemPosition - highlightStart);
2879  if (highlightEnd != highlightStart) {
2880  d->maxExtent = d->isRightToLeft()
2881  ? qMax(d->maxExtent, -(d->endPosition() - highlightEnd + 1))
2882  : qMin(d->maxExtent, -(d->endPosition() - highlightEnd + 1));
2883  }
2884  } else {
2885  d->maxExtent = -(d->endPosition() - width() + 1);
2886  }
2887  if (d->isRightToLeft()) {
2888  if (d->header && d->visibleItems.count())
2889  d->maxExtent -= d->header->size();
2890  } else {
2891  if (d->footer)
2892  d->maxExtent -= d->footer->size();
2893  qreal minX = minXExtent();
2894  if (d->maxExtent > minX)
2895  d->maxExtent = minX;
2896  }
2897  d->maxExtentDirty = false;
2898  }
2899  return d->maxExtent;
2900 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual qreal minXExtent() const

◆ maxYExtent()

qreal QDeclarativeListView::maxYExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2785 of file qdeclarativelistview.cpp.

Referenced by viewportMoved().

2786 {
2787  Q_D(const QDeclarativeListView);
2788  if (d->orient == QDeclarativeListView::Horizontal)
2789  return height();
2790  if (d->maxExtentDirty) {
2791  if (!d->model || !d->model->count()) {
2792  d->maxExtent = d->header ? -d->header->size() : 0;
2793  d->maxExtent += height();
2794  } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2795  d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart);
2796  if (d->highlightRangeEnd != d->highlightRangeStart)
2797  d->maxExtent = qMin(d->maxExtent, -(d->endPosition() - d->highlightRangeEnd + 1));
2798  } else {
2799  d->maxExtent = -(d->endPosition() - height() + 1);
2800  }
2801  if (d->footer)
2802  d->maxExtent -= d->footer->size();
2803  qreal minY = minYExtent();
2804  if (d->maxExtent > minY)
2805  d->maxExtent = minY;
2806  d->maxExtentDirty = false;
2807  }
2808  return d->maxExtent;
2809 }
virtual qreal minYExtent() const
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ minXExtent()

qreal QDeclarativeListView::minXExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2811 of file qdeclarativelistview.cpp.

Referenced by maxXExtent(), and viewportMoved().

2812 {
2813  Q_D(const QDeclarativeListView);
2814  if (d->orient == QDeclarativeListView::Vertical)
2816  if (d->minExtentDirty) {
2817  d->minExtent = -d->startPosition();
2818 
2819  qreal highlightStart;
2820  qreal highlightEnd;
2821  qreal endPositionFirstItem = 0;
2822  if (d->isRightToLeft()) {
2823  if (d->model && d->model->count())
2824  endPositionFirstItem = d->positionAt(d->model->count()-1);
2825  else if (d->header)
2826  d->minExtent += d->header->size();
2827  highlightStart = d->highlightRangeStartValid
2828  ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
2829  : d->size() - (d->lastPosition()-endPositionFirstItem);
2830  highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
2831  if (d->footer)
2832  d->minExtent += d->footer->size();
2833  qreal maxX = maxXExtent();
2834  if (d->minExtent < maxX)
2835  d->minExtent = maxX;
2836  } else {
2837  endPositionFirstItem = d->endPositionAt(0);
2838  highlightStart = d->highlightRangeStart;
2839  highlightEnd = d->highlightRangeEnd;
2840  if (d->header && d->visibleItems.count())
2841  d->minExtent += d->header->size();
2842  }
2843  if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2844  d->minExtent += d->isRightToLeft() ? -highlightStart : highlightStart;
2845  d->minExtent = qMax(d->minExtent, -(endPositionFirstItem - highlightEnd + 1));
2846  }
2847  d->minExtentDirty = false;
2848  }
2849 
2850  return d->minExtent;
2851 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual qreal maxXExtent() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual qreal minXExtent() const

◆ minYExtent()

qreal QDeclarativeListView::minYExtent ( ) const
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2762 of file qdeclarativelistview.cpp.

Referenced by maxYExtent(), and viewportMoved().

2763 {
2764  Q_D(const QDeclarativeListView);
2765  if (d->orient == QDeclarativeListView::Horizontal)
2767  if (d->minExtentDirty) {
2768  d->minExtent = -d->startPosition();
2769  if (d->header && d->visibleItems.count())
2770  d->minExtent += d->header->size();
2771  if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
2772  d->minExtent += d->highlightRangeStart;
2773  if (d->sectionCriteria) {
2774  if (d->visibleItem(0))
2775  d->minExtent -= d->visibleItem(0)->sectionSize();
2776  }
2777  d->minExtent = qMax(d->minExtent, -(d->endPositionAt(0) - d->highlightRangeEnd + 1));
2778  }
2779  d->minExtentDirty = false;
2780  }
2781 
2782  return d->minExtent;
2783 }
QDeclarativeParserStatus ** d
#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

◆ model()

QVariant QDeclarativeListView::model ( ) const

◆ modelChanged

void QDeclarativeListView::modelChanged ( )
signal

Referenced by setModel().

◆ modelReset

void QDeclarativeListView::modelReset ( )
privateslot

Definition at line 3694 of file qdeclarativelistview.cpp.

Referenced by setModel().

3695 {
3698  d->regenerate();
3699  if (d->highlight && d->currentItem) {
3700  if (d->autoHighlight)
3701  d->highlight->setPosition(d->currentItem->position());
3702  d->updateTrackedItem();
3703  }
3704  d->moveReason = QDeclarativeListViewPrivate::Other;
3705  emit countChanged();
3706 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ orientation()

Orientation QDeclarativeListView::orientation ( ) const

Referenced by setOrientation(), and setSpacing().

◆ orientationChanged

void QDeclarativeListView::orientationChanged ( )
signal

Referenced by setOrientation().

◆ positionViewAtBeginning()

void QDeclarativeListView::positionViewAtBeginning ( )

Definition at line 3148 of file qdeclarativelistview.cpp.

3149 {
3151  if (!d->isValid())
3152  return;
3153  d->positionViewAtIndex(-1, Beginning);
3154 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ positionViewAtEnd()

void QDeclarativeListView::positionViewAtEnd ( )

Definition at line 3156 of file qdeclarativelistview.cpp.

3157 {
3159  if (!d->isValid())
3160  return;
3161  d->positionViewAtIndex(d->model->count(), End);
3162 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ positionViewAtIndex()

void QDeclarativeListView::positionViewAtIndex ( int  index,
int  mode 
)

Definition at line 3117 of file qdeclarativelistview.cpp.

3118 {
3120  if (!d->isValid() || index < 0 || index >= d->model->count())
3121  return;
3122  d->positionViewAtIndex(index, mode);
3123 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 index

◆ preferredHighlightBegin()

qreal QDeclarativeListView::preferredHighlightBegin ( ) const

◆ preferredHighlightBeginChanged

void QDeclarativeListView::preferredHighlightBeginChanged ( )
signal

◆ preferredHighlightEnd()

qreal QDeclarativeListView::preferredHighlightEnd ( ) const

◆ preferredHighlightEndChanged

void QDeclarativeListView::preferredHighlightEndChanged ( )
signal

◆ qmlAttachedProperties()

QDeclarativeListViewAttached * QDeclarativeListView::qmlAttachedProperties ( QObject obj)
static

Definition at line 3739 of file qdeclarativelistview.cpp.

◆ refill

void QDeclarativeListView::refill ( )
privateslot

Definition at line 3229 of file qdeclarativelistview.cpp.

Referenced by componentComplete(), itemsMoved(), setCacheBuffer(), setDelegate(), setModel(), and viewportMoved().

3230 {
3232  if (d->isRightToLeft())
3233  d->refill(-d->position()-d->size()+1, -d->position());
3234  else
3235  d->refill(d->position(), d->position()+d->size()-1);
3236 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ resetPreferredHighlightBegin()

void QDeclarativeListView::resetPreferredHighlightBegin ( )

Definition at line 2113 of file qdeclarativelistview.cpp.

2114 {
2116  d->highlightRangeStartValid = false;
2117  if (d->highlightRangeStart == 0)
2118  return;
2119  d->highlightRangeStart = 0;
2121 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void preferredHighlightBeginChanged()
#define emit
Definition: qobjectdefs.h:76

◆ resetPreferredHighlightEnd()

void QDeclarativeListView::resetPreferredHighlightEnd ( )

Definition at line 2140 of file qdeclarativelistview.cpp.

2141 {
2143  d->highlightRangeEndValid = false;
2144  if (d->highlightRangeEnd == 0)
2145  return;
2146  d->highlightRangeEnd = 0;
2148 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void preferredHighlightEndChanged()

◆ sectionCriteria()

QDeclarativeViewSection * QDeclarativeListView::sectionCriteria ( )

Definition at line 2411 of file qdeclarativelistview.cpp.

2412 {
2414  if (!d->sectionCriteria) {
2415  d->sectionCriteria = new QDeclarativeViewSection(this);
2416  connect(d->sectionCriteria, SIGNAL(propertyChanged()), this, SLOT(updateSections()));
2417  }
2418  return d->sectionCriteria;
2419 }
QDeclarativeParserStatus ** d
#define SLOT(a)
Definition: qobjectdefs.h:226
#define Q_D(Class)
Definition: qglobal.h:2482
#define SIGNAL(a)
Definition: qobjectdefs.h:227
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 rece...
Definition: qobject.cpp:2580

◆ setCacheBuffer()

void QDeclarativeListView::setCacheBuffer ( int  b)

Definition at line 2344 of file qdeclarativelistview.cpp.

2345 {
2347  if (d->buffer != b) {
2348  d->buffer = b;
2349  if (isComponentComplete()) {
2351  refill();
2352  }
2354  }
2355 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setContentX()

void QDeclarativeListView::setContentX ( qreal  pos)
virtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2646 of file qdeclarativelistview.cpp.

Referenced by geometryChanged(), and setOrientation().

2647 {
2649  // Positioning the view manually should override any current movement state
2650  d->moveReason = QDeclarativeListViewPrivate::Other;
2652 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void setContentX(qreal pos)

◆ setContentY()

void QDeclarativeListView::setContentY ( qreal  pos)
virtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2654 of file qdeclarativelistview.cpp.

Referenced by setOrientation().

2655 {
2657  // Positioning the view manually should override any current movement state
2658  d->moveReason = QDeclarativeListViewPrivate::Other;
2660 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void setContentY(qreal pos)

◆ setCurrentIndex()

void QDeclarativeListView::setCurrentIndex ( int  idx)

Definition at line 1922 of file qdeclarativelistview.cpp.

Referenced by decrementCurrentIndex(), incrementCurrentIndex(), and setModel().

1923 {
1925  if (d->requestedIndex >= 0) // currently creating item
1926  return;
1927  d->currentIndexCleared = (index == -1);
1928  if (index == d->currentIndex)
1929  return;
1930  if (isComponentComplete() && d->isValid()) {
1931  if (d->layoutScheduled)
1932  d->layout();
1934  d->updateCurrent(index);
1935  } else if (d->currentIndex != index) {
1936  d->currentIndex = index;
1938  }
1939 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
quint16 index

◆ setDelegate()

void QDeclarativeListView::setDelegate ( QDeclarativeComponent delegate)

Definition at line 1863 of file qdeclarativelistview.cpp.

1864 {
1866  if (delegate == this->delegate())
1867  return;
1868  if (!d->ownModel) {
1869  d->model = new QDeclarativeVisualDataModel(qmlContext(this));
1870  d->ownModel = true;
1871  }
1872  if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
1873  int oldCount = dataModel->count();
1874  dataModel->setDelegate(delegate);
1875  if (isComponentComplete()) {
1876  for (int i = 0; i < d->visibleItems.count(); ++i)
1877  d->releaseItem(d->visibleItems.at(i));
1878  d->visibleItems.clear();
1879  d->releaseItem(d->currentItem);
1880  d->currentItem = 0;
1881  updateSections();
1882  refill();
1884  d->updateCurrent(d->currentIndex);
1885  if (d->highlight && d->currentItem) {
1886  if (d->autoHighlight)
1887  d->highlight->setPosition(d->currentItem->position());
1888  d->updateTrackedItem();
1889  }
1890  d->updateViewport();
1891  }
1892  if (oldCount != dataModel->count())
1893  emit countChanged();
1894  }
1896 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QDeclarativeComponent * delegate() const
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setFooter()

void QDeclarativeListView::setFooter ( QDeclarativeComponent footer)

Definition at line 2581 of file qdeclarativelistview.cpp.

2582 {
2584  if (d->footerComponent != footer) {
2585  if (d->footer) {
2586  if (scene())
2587  scene()->removeItem(d->footer->item);
2588  d->footer->item->deleteLater();
2589  delete d->footer;
2590  d->footer = 0;
2591  }
2592  d->footerComponent = footer;
2593  d->minExtentDirty = true;
2594  d->maxExtentDirty = true;
2595  if (isComponentComplete()) {
2596  d->updateFooter();
2597  d->updateViewport();
2598  d->fixupPosition();
2599  }
2600  emit footerChanged();
2601  }
2602 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QDeclarativeComponent * footer() const
#define Q_D(Class)
Definition: qglobal.h:2482
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
#define emit
Definition: qobjectdefs.h:76
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.

◆ setHeader()

void QDeclarativeListView::setHeader ( QDeclarativeComponent header)

Definition at line 2622 of file qdeclarativelistview.cpp.

2623 {
2625  if (d->headerComponent != header) {
2626  if (d->header) {
2627  if (scene())
2628  scene()->removeItem(d->header->item);
2629  d->header->item->deleteLater();
2630  delete d->header;
2631  d->header = 0;
2632  }
2633  d->headerComponent = header;
2634  d->minExtentDirty = true;
2635  d->maxExtentDirty = true;
2636  if (isComponentComplete()) {
2637  d->updateHeader();
2638  d->updateFooter();
2639  d->updateViewport();
2640  d->fixupPosition();
2641  }
2642  emit headerChanged();
2643  }
2644 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
#define emit
Definition: qobjectdefs.h:76
QDeclarativeComponent * header() const
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.

◆ setHighlight()

void QDeclarativeListView::setHighlight ( QDeclarativeComponent highlight)

Definition at line 2005 of file qdeclarativelistview.cpp.

2006 {
2008  if (highlight != d->highlightComponent) {
2009  d->highlightComponent = highlight;
2010  d->createHighlight();
2011  if (d->currentItem)
2012  d->updateHighlight();
2014  }
2015 }
QDeclarativeParserStatus ** d
QDeclarativeComponent * highlight() const
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setHighlightFollowsCurrentItem()

void QDeclarativeListView::setHighlightFollowsCurrentItem ( bool  autoHighlight)

Definition at line 2045 of file qdeclarativelistview.cpp.

2046 {
2048  if (d->autoHighlight != autoHighlight) {
2049  d->autoHighlight = autoHighlight;
2050  if (autoHighlight) {
2051  d->updateHighlight();
2052  } else {
2053  if (d->highlightPosAnimator)
2054  d->highlightPosAnimator->stop();
2055  if (d->highlightSizeAnimator)
2056  d->highlightSizeAnimator->stop();
2057  }
2059  }
2060 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void highlightFollowsCurrentItemChanged()

◆ setHighlightMoveDuration()

void QDeclarativeListView::setHighlightMoveDuration ( int  duration)

Definition at line 2479 of file qdeclarativelistview.cpp.

2480 {
2482  if (d->highlightMoveDuration != duration) {
2483  d->highlightMoveDuration = duration;
2484  if (d->highlightPosAnimator)
2485  d->highlightPosAnimator->userDuration = d->highlightMoveDuration;
2487  }
2488 }
QDeclarativeParserStatus ** d
void highlightMoveDurationChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setHighlightMoveSpeed()

void QDeclarativeListView::setHighlightMoveSpeed ( qreal  speed)

Definition at line 2462 of file qdeclarativelistview.cpp.

2463 {
2465  if (d->highlightMoveSpeed != speed) {
2466  d->highlightMoveSpeed = speed;
2467  if (d->highlightPosAnimator)
2468  d->highlightPosAnimator->velocity = d->highlightMoveSpeed;
2470  }
2471 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void highlightMoveSpeedChanged()

◆ setHighlightRangeMode()

void QDeclarativeListView::setHighlightRangeMode ( HighlightRangeMode  mode)

Definition at line 2156 of file qdeclarativelistview.cpp.

2157 {
2159  if (d->highlightRange == mode)
2160  return;
2161  d->highlightRange = mode;
2162  d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
2164 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void highlightRangeModeChanged()
#define emit
Definition: qobjectdefs.h:76

◆ setHighlightResizeDuration()

void QDeclarativeListView::setHighlightResizeDuration ( int  duration)

Definition at line 2513 of file qdeclarativelistview.cpp.

2514 {
2516  if (d->highlightResizeDuration != duration) {
2517  d->highlightResizeDuration = duration;
2518  if (d->highlightSizeAnimator)
2519  d->highlightSizeAnimator->userDuration = d->highlightResizeDuration;
2521  }
2522 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void highlightResizeDurationChanged()

◆ setHighlightResizeSpeed()

void QDeclarativeListView::setHighlightResizeSpeed ( qreal  speed)

Definition at line 2496 of file qdeclarativelistview.cpp.

2497 {
2499  if (d->highlightResizeSpeed != speed) {
2500  d->highlightResizeSpeed = speed;
2501  if (d->highlightSizeAnimator)
2502  d->highlightSizeAnimator->velocity = d->highlightResizeSpeed;
2504  }
2505 }
QDeclarativeParserStatus ** d
void highlightResizeSpeedChanged()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setLayoutDirection()

void QDeclarativeListView::setLayoutDirection ( Qt::LayoutDirection  layoutDirection)

Definition at line 2269 of file qdeclarativelistview.cpp.

2270 {
2272  if (d->layoutDirection != layoutDirection) {
2273  d->layoutDirection = layoutDirection;
2274  d->regenerate();
2276  }
2277 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
Qt::LayoutDirection layoutDirection() const
#define emit
Definition: qobjectdefs.h:76

◆ setModel()

void QDeclarativeListView::setModel ( const QVariant model)

Definition at line 1761 of file qdeclarativelistview.cpp.

1762 {
1764  if (d->modelVariant == model)
1765  return;
1766  if (d->model) {
1767  disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
1768  disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
1769  disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
1770  disconnect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int)));
1771  disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
1774  }
1775  d->clear();
1776  QDeclarativeVisualModel *oldModel = d->model;
1777  d->model = 0;
1778  d->setPosition(0);
1779  d->modelVariant = model;
1780  QObject *object = qvariant_cast<QObject*>(model);
1781  QDeclarativeVisualModel *vim = 0;
1782  if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
1783  if (d->ownModel) {
1784  delete oldModel;
1785  d->ownModel = false;
1786  }
1787  d->model = vim;
1788  } else {
1789  if (!d->ownModel) {
1790  d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
1791  d->ownModel = true;
1792  } else {
1793  d->model = oldModel;
1794  }
1795  if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
1796  dataModel->setModel(model);
1797  }
1798  if (d->model) {
1800  if (isComponentComplete()) {
1801  updateSections();
1802  refill();
1803  if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexCleared) {
1804  setCurrentIndex(0);
1805  } else {
1807  d->updateCurrent(d->currentIndex);
1808  if (d->highlight && d->currentItem) {
1809  if (d->autoHighlight)
1810  d->highlight->setPosition(d->currentItem->position());
1811  d->updateTrackedItem();
1812  }
1813  }
1814  d->updateViewport();
1815  }
1816  connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
1817  connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
1818  connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
1819  connect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int)));
1820  connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
1823  emit countChanged();
1824  }
1825  emit modelChanged();
1826 }
QDeclarativeParserStatus ** d
void destroyingItem(QDeclarativeItem *item)
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
void itemsRemoved(int index, int count)
#define SLOT(a)
Definition: qobjectdefs.h:226
QVariant model() const
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
void itemsMoved(int from, int to, int count)
#define Q_D(Class)
Definition: qglobal.h:2482
#define SIGNAL(a)
Definition: qobjectdefs.h:227
The QDeclarativeItem class provides the most basic of all visual items in QML.
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 rece...
Definition: qobject.cpp:2580
#define emit
Definition: qobjectdefs.h:76
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.
Definition: qobject.cpp:2895
void itemsInserted(int index, int count)
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
void itemsChanged(int index, int count)
void createdItem(int index, QDeclarativeItem *item)

◆ setOrientation()

void QDeclarativeListView::setOrientation ( QDeclarativeListView::Orientation  orientation)

Definition at line 2222 of file qdeclarativelistview.cpp.

2223 {
2225  if (d->orient != orientation) {
2226  d->orient = orientation;
2227  if (d->orient == QDeclarativeListView::Vertical) {
2228  setContentWidth(-1);
2230  setContentX(0);
2231  } else {
2232  setContentHeight(-1);
2234  setContentY(0);
2235  }
2236  d->regenerate();
2238  }
2239 }
void setFlickableDirection(FlickableDirection)
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void setContentY(qreal pos)
Orientation orientation() const
virtual void setContentX(qreal pos)
#define emit
Definition: qobjectdefs.h:76

◆ setPreferredHighlightBegin()

void QDeclarativeListView::setPreferredHighlightBegin ( qreal  start)

Definition at line 2102 of file qdeclarativelistview.cpp.

2103 {
2105  d->highlightRangeStartValid = true;
2106  if (d->highlightRangeStart == start)
2107  return;
2108  d->highlightRangeStart = start;
2109  d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
2111 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void preferredHighlightBeginChanged()
#define emit
Definition: qobjectdefs.h:76

◆ setPreferredHighlightEnd()

void QDeclarativeListView::setPreferredHighlightEnd ( qreal  end)

Definition at line 2129 of file qdeclarativelistview.cpp.

2130 {
2132  d->highlightRangeEndValid = true;
2133  if (d->highlightRangeEnd == end)
2134  return;
2135  d->highlightRangeEnd = end;
2136  d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
2138 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
static const KeyPair *const end
void preferredHighlightEndChanged()

◆ setSnapMode()

void QDeclarativeListView::setSnapMode ( SnapMode  mode)

Definition at line 2554 of file qdeclarativelistview.cpp.

2555 {
2557  if (d->snapMode != mode) {
2558  d->snapMode = mode;
2560  }
2561 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setSpacing()

void QDeclarativeListView::setSpacing ( qreal  spacing)

Definition at line 2182 of file qdeclarativelistview.cpp.

2183 {
2185  if (spacing != d->spacing) {
2186  d->spacing = spacing;
2187  d->layout();
2188  emit spacingChanged();
2189  }
2190 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
qreal spacing() const
#define emit
Definition: qobjectdefs.h:76

◆ setWrapEnabled()

void QDeclarativeListView::setWrapEnabled ( bool  wrap)

Definition at line 2307 of file qdeclarativelistview.cpp.

2308 {
2310  if (d->wrap == wrap)
2311  return;
2312  d->wrap = wrap;
2314 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void keyNavigationWrapsChanged()

◆ snapMode()

SnapMode QDeclarativeListView::snapMode ( ) const

◆ snapModeChanged

void QDeclarativeListView::snapModeChanged ( )
signal

Referenced by setSnapMode().

◆ spacing()

qreal QDeclarativeListView::spacing ( ) const

◆ spacingChanged

void QDeclarativeListView::spacingChanged ( )
signal

Referenced by setSpacing().

◆ trackedPositionChanged

void QDeclarativeListView::trackedPositionChanged ( )
privateslot

Definition at line 3238 of file qdeclarativelistview.cpp.

3239 {
3241  if (!d->trackedItem || !d->currentItem)
3242  return;
3243  if (d->moveReason == QDeclarativeListViewPrivate::SetIndex) {
3244  qreal trackedPos = qCeil(d->trackedItem->position());
3245  qreal trackedSize = d->trackedItem->size();
3246  if (d->trackedItem != d->currentItem) {
3247  trackedPos -= d->currentItem->sectionSize();
3248  trackedSize += d->currentItem->sectionSize();
3249  }
3250  qreal viewPos;
3251  qreal highlightStart;
3252  qreal highlightEnd;
3253  if (d->isRightToLeft()) {
3254  viewPos = -d->position()-d->size();
3255  highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
3256  highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
3257  } else {
3258  viewPos = d->position();
3259  highlightStart = d->highlightRangeStart;
3260  highlightEnd = d->highlightRangeEnd;
3261  }
3262  qreal pos = viewPos;
3263  if (d->haveHighlightRange) {
3264  if (d->highlightRange == StrictlyEnforceRange) {
3265  if (trackedPos > pos + highlightEnd - d->trackedItem->size())
3266  pos = trackedPos - highlightEnd + d->trackedItem->size();
3267  if (trackedPos < pos + highlightStart)
3268  pos = trackedPos - highlightStart;
3269  } else {
3270  if (trackedPos < d->startPosition() + highlightStart) {
3271  pos = d->startPosition();
3272  } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + highlightEnd) {
3273  pos = d->endPosition() - d->size() + 1;
3274  if (pos < d->startPosition())
3275  pos = d->startPosition();
3276  } else {
3277  if (trackedPos < viewPos + highlightStart) {
3278  pos = trackedPos - highlightStart;
3279  } else if (trackedPos > viewPos + highlightEnd - trackedSize) {
3280  pos = trackedPos - highlightEnd + trackedSize;
3281  }
3282  }
3283  }
3284  } else {
3285  if (trackedPos < viewPos && d->currentItem->position() < viewPos) {
3286  pos = d->currentItem->position() < trackedPos ? trackedPos : d->currentItem->position();
3287  } else if (d->trackedItem->endPosition() >= viewPos + d->size()
3288  && d->currentItem->endPosition() >= viewPos + d->size()) {
3289  if (d->trackedItem->endPosition() <= d->currentItem->endPosition()) {
3290  pos = d->trackedItem->endPosition() - d->size() + 1;
3291  if (trackedSize > d->size())
3292  pos = trackedPos;
3293  } else {
3294  pos = d->currentItem->endPosition() - d->size() + 1;
3295  if (d->currentItem->size() > d->size())
3296  pos = d->currentItem->position();
3297  }
3298  }
3299  }
3300  if (viewPos != pos) {
3301  cancelFlick();
3302  d->calcVelocity = true;
3303  d->setPosition(pos);
3304  d->calcVelocity = false;
3305  }
3306  }
3307 }
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
int qCeil(qreal v)
Definition: qmath.h:63
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeItem * currentItem()

◆ updateSections

void QDeclarativeListView::updateSections ( )
privateslot

Definition at line 3215 of file qdeclarativelistview.cpp.

Referenced by componentComplete(), sectionCriteria(), setDelegate(), and setModel().

3216 {
3218  if (isComponentComplete() && d->model) {
3219  QList<QByteArray> roles;
3220  if (d->sectionCriteria && !d->sectionCriteria->property().isEmpty())
3221  roles << d->sectionCriteria->property().toUtf8();
3222  d->model->setWatchedRoles(roles);
3223  d->updateSections();
3224  if (d->itemCount)
3225  d->layout();
3226  }
3227 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ viewportMoved()

void QDeclarativeListView::viewportMoved ( )
protectedvirtual

Reimplemented from QDeclarativeFlickable.

Definition at line 2674 of file qdeclarativelistview.cpp.

2675 {
2678  if (!d->itemCount)
2679  return;
2680  // Recursion can occur due to refill changing the content size.
2681  if (d->inViewportMoved)
2682  return;
2683  d->inViewportMoved = true;
2684  d->lazyRelease = true;
2685  refill();
2686  if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
2687  d->moveReason = QDeclarativeListViewPrivate::Mouse;
2688  if (d->moveReason != QDeclarativeListViewPrivate::SetIndex) {
2689  if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
2690  // reposition highlight
2691  qreal pos = d->highlight->position();
2692  qreal viewPos;
2693  qreal highlightStart;
2694  qreal highlightEnd;
2695  if (d->isRightToLeft()) {
2696  // Handle Right-To-Left exceptions
2697  viewPos = -d->position()-d->size();
2698  highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
2699  highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
2700  } else {
2701  viewPos = d->position();
2702  highlightStart = d->highlightRangeStart;
2703  highlightEnd = d->highlightRangeEnd;
2704  }
2705  if (pos > viewPos + highlightEnd - d->highlight->size())
2706  pos = viewPos + highlightEnd - d->highlight->size();
2707  if (pos < viewPos + highlightStart)
2708  pos = viewPos + highlightStart;
2709  d->highlightPosAnimator->stop();
2710  d->highlight->setPosition(qRound(pos));
2711 
2712  // update current index
2713  if (FxListItem *snapItem = d->snapItemAt(d->highlight->position())) {
2714  if (snapItem->index >= 0 && snapItem->index != d->currentIndex)
2715  d->updateCurrent(snapItem->index);
2716  }
2717  }
2718  }
2719 
2720  if ((d->hData.flicking || d->vData.flicking) && d->correctFlick && !d->inFlickCorrection) {
2721  d->inFlickCorrection = true;
2722  // Near an end and it seems that the extent has changed?
2723  // Recalculate the flick so that we don't end up in an odd position.
2724  if (yflick() && !d->vData.inOvershoot) {
2725  if (d->vData.velocity > 0) {
2726  const qreal minY = minYExtent();
2727  if ((minY - d->vData.move.value() < height()/2 || d->vData.flickTarget - d->vData.move.value() < height()/2)
2728  && minY != d->vData.flickTarget)
2729  d->flickY(-d->vData.smoothVelocity.value());
2731  } else if (d->vData.velocity < 0) {
2732  const qreal maxY = maxYExtent();
2733  if ((d->vData.move.value() - maxY < height()/2 || d->vData.move.value() - d->vData.flickTarget < height()/2)
2734  && maxY != d->vData.flickTarget)
2735  d->flickY(-d->vData.smoothVelocity.value());
2737  }
2738  }
2739 
2740  if (xflick() && !d->hData.inOvershoot) {
2741  if (d->hData.velocity > 0) {
2742  const qreal minX = minXExtent();
2743  if ((minX - d->hData.move.value() < width()/2 || d->hData.flickTarget - d->hData.move.value() < width()/2)
2744  && minX != d->hData.flickTarget)
2745  d->flickX(-d->hData.smoothVelocity.value());
2746  d->bufferMode = d->isRightToLeft()
2748  } else if (d->hData.velocity < 0) {
2749  const qreal maxX = maxXExtent();
2750  if ((d->hData.move.value() - maxX < width()/2 || d->hData.move.value() - d->hData.flickTarget < width()/2)
2751  && maxX != d->hData.flickTarget)
2752  d->flickX(-d->hData.smoothVelocity.value());
2753  d->bufferMode = d->isRightToLeft()
2755  }
2756  }
2757  d->inFlickCorrection = false;
2758  }
2759  d->inViewportMoved = false;
2760 }
virtual qreal minYExtent() const
double qreal
Definition: qglobal.h:1193
QDeclarativeParserStatus ** d
virtual qreal maxYExtent() const
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
virtual qreal maxXExtent() const
virtual qreal minXExtent() const
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

Properties

◆ cacheBuffer

int QDeclarativeListView::cacheBuffer
private

Definition at line 118 of file qdeclarativelistview_p.h.

◆ count

int QDeclarativeListView::count
private

Definition at line 100 of file qdeclarativelistview_p.h.

◆ currentIndex

int QDeclarativeListView::currentIndex
private

Definition at line 98 of file qdeclarativelistview_p.h.

◆ currentItem

QDeclarativeItem * QDeclarativeListView::currentItem
private

Definition at line 99 of file qdeclarativelistview_p.h.

◆ currentSection

QString QDeclarativeListView::currentSection
private

Definition at line 120 of file qdeclarativelistview_p.h.

◆ delegate

QDeclarativeComponent * QDeclarativeListView::delegate
private

Definition at line 97 of file qdeclarativelistview_p.h.

◆ footer

QDeclarativeComponent * QDeclarativeListView::footer
private

Definition at line 125 of file qdeclarativelistview_p.h.

◆ header

QDeclarativeComponent * QDeclarativeListView::header
private

Definition at line 124 of file qdeclarativelistview_p.h.

◆ highlight

QDeclarativeComponent * QDeclarativeListView::highlight
private

Definition at line 102 of file qdeclarativelistview_p.h.

◆ highlightFollowsCurrentItem

bool QDeclarativeListView::highlightFollowsCurrentItem
private

Definition at line 104 of file qdeclarativelistview_p.h.

◆ highlightItem

QDeclarativeItem * QDeclarativeListView::highlightItem
private

Definition at line 103 of file qdeclarativelistview_p.h.

◆ highlightMoveDuration

int QDeclarativeListView::highlightMoveDuration
private

Definition at line 106 of file qdeclarativelistview_p.h.

◆ highlightMoveSpeed

qreal QDeclarativeListView::highlightMoveSpeed
private

Definition at line 105 of file qdeclarativelistview_p.h.

◆ highlightRangeMode

QDeclarativeListView::HighlightRangeMode QDeclarativeListView::highlightRangeMode
private

Definition at line 112 of file qdeclarativelistview_p.h.

◆ highlightResizeDuration

int QDeclarativeListView::highlightResizeDuration
private

Definition at line 108 of file qdeclarativelistview_p.h.

◆ highlightResizeSpeed

qreal QDeclarativeListView::highlightResizeSpeed
private

Definition at line 107 of file qdeclarativelistview_p.h.

◆ keyNavigationWraps

bool QDeclarativeListView::keyNavigationWraps
private

Definition at line 117 of file qdeclarativelistview_p.h.

◆ layoutDirection

Qt::LayoutDirection QDeclarativeListView::layoutDirection
private

Definition at line 116 of file qdeclarativelistview_p.h.

◆ model

QVariant QDeclarativeListView::model
private

Definition at line 96 of file qdeclarativelistview_p.h.

◆ orientation

QDeclarativeListView::Orientation QDeclarativeListView::orientation
private

Definition at line 115 of file qdeclarativelistview_p.h.

◆ preferredHighlightBegin

qreal QDeclarativeListView::preferredHighlightBegin
private

Definition at line 110 of file qdeclarativelistview_p.h.

◆ preferredHighlightEnd

qreal QDeclarativeListView::preferredHighlightEnd
private

Definition at line 111 of file qdeclarativelistview_p.h.

◆ section

QDeclarativeViewSection* QDeclarativeListView::section
private

Definition at line 119 of file qdeclarativelistview_p.h.

◆ snapMode

QDeclarativeListView::SnapMode QDeclarativeListView::snapMode
private

Definition at line 122 of file qdeclarativelistview_p.h.

◆ spacing

qreal QDeclarativeListView::spacing
private

Definition at line 114 of file qdeclarativelistview_p.h.


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