Qt 4.8
Public Types | Public Functions | Public Variables | Static Public Variables | List of all members
QDeclarativeListViewPrivate Class Reference
Inheritance diagram for QDeclarativeListViewPrivate:
QDeclarativeFlickablePrivate QDeclarativeItemPrivate QDeclarativeItemChangeListener QGraphicsItemPrivate

Public Types

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

Public Functions

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

Public Variables

bool autoHighlight: 1
 
qreal averageSize
 
int buffer
 
int bufferMode
 
bool correctFlick: 1
 
int currentIndex
 
bool currentIndexCleared: 1
 
FxListItemcurrentItem
 
QString currentSection
 
bool deferredRelease: 1
 
FxListItemfooter
 
QDeclarativeComponentfooterComponent
 
bool haveHighlightRange: 1
 
FxListItemheader
 
QDeclarativeComponentheaderComponent
 
FxListItemhighlight
 
QDeclarativeComponenthighlightComponent
 
int highlightMoveDuration
 
qreal highlightMoveSpeed
 
QSmoothedAnimationhighlightPosAnimator
 
QDeclarativeListView::HighlightRangeMode highlightRange
 
qreal highlightRangeEnd
 
bool highlightRangeEndValid
 
qreal highlightRangeStart
 
bool highlightRangeStartValid
 
int highlightResizeDuration
 
qreal highlightResizeSpeed
 
QSmoothedAnimationhighlightSizeAnimator
 
bool inFlickCorrection: 1
 
bool inViewportMoved: 1
 
int itemCount
 
Qt::LayoutDirection layoutDirection
 
bool layoutScheduled: 1
 
bool lazyRelease: 1
 
qreal maxExtent
 
bool maxExtentDirty: 1
 
qreal minExtent
 
bool minExtentDirty: 1
 
QDeclarativeGuard< QDeclarativeVisualModelmodel
 
QVariant modelVariant
 
MovementReason moveReason
 
QDeclarativeListView::Orientation orient
 
qreal overshootDist
 
bool ownModel: 1
 
int requestedIndex
 
QDeclarativeItemsectionCache [sectionCacheSize]
 
QDeclarativeViewSectionsectionCriteria
 
QDeclarativeListView::SnapMode snapMode
 
qreal spacing
 
FxListItemtrackedItem
 
QHash< QDeclarativeItem *, int > unrequestedItems
 
int visibleIndex
 
QList< FxListItem * > visibleItems
 
qreal visiblePos
 
bool wrap: 1
 
- Public Variables inherited from QDeclarativeFlickablePrivate
QDeclarativeFlickable::BoundsBehavior boundsBehavior
 
bool calcVelocity: 1
 
QDeclarativeItemcontentItem
 
qreal deceleration
 
QGraphicsSceneMouseEventdelayedPressEvent
 
QGraphicsItemdelayedPressTarget
 
QBasicTimer delayedPressTimer
 
int fixupDuration
 
FixupMode fixupMode
 
QDeclarativeFlickable::FlickableDirection flickableDirection
 
AxisData hData
 
bool hMoved: 1
 
bool interactive: 1
 
QPointF lastFlickablePosition
 
QPointF lastPos
 
QElapsedTimer lastPosTime
 
qreal maxVelocity
 
int pressDelay
 
bool pressed: 1
 
QPointF pressPos
 
QElapsedTimer pressTime
 
qreal reportedVelocitySmoothing
 
bool stealMouse: 1
 
QDeclarativeTimeLine timeline
 
AxisData vData
 
QElapsedTimer velocityTime
 
QDeclarativeTimeLine velocityTimeline
 
QDeclarativeFlickableVisibleAreavisibleArea
 
bool vMoved: 1
 
int vTime
 
- Public Variables inherited from QDeclarativeItemPrivate
AnchorLines_anchorLines
 
QDeclarativeAnchors_anchors
 
QDeclarativeContents_contents
 
QDeclarativeStateGroup_stateGroup
 
QDeclarativeLayoutMirroringAttachedattachedLayoutDirection
 
QDeclarativeNullableValue< qrealbaselineOffset
 
QPODVector< ChangeListener, 4 > changeListeners
 
bool componentComplete:1
 
bool doneEventPreHandler: 1
 
bool effectiveLayoutMirror:1
 
bool hadActiveFocus:1
 
bool hadFocus:1
 
bool heightValid:1
 
bool inheritedLayoutMirror:1
 
bool inheritMirrorFromItem:1
 
bool inheritMirrorFromParent:1
 
bool isMirrorImplicit:1
 
bool keepMouse:1
 
QDeclarativeItemKeyFilterkeyHandler
 
qreal mHeight
 
qreal mImplicitHeight
 
qreal mImplicitWidth
 
qreal mWidth
 
QDeclarativeItem::TransformOrigin origin:5
 
QDeclarativeNotifier parentNotifier
 
bool smooth:1
 
bool transformOriginDirty: 1
 
bool widthValid:1
 
- Public Variables inherited from QGraphicsItemPrivate
quint32 acceptDrops: 1
 
quint32 acceptedMouseButtons: 5
 
quint32 acceptedTouchBeginEvent: 1
 
quint32 acceptsHover: 1
 
quint32 acceptTouchEvents: 1
 
quint32 allChildrenDirty: 1
 
quint32 ancestorFlags: 4
 
quint32 cacheMode: 2
 
QList< QGraphicsItem * > children
 
QRectF childrenBoundingRect
 
quint32 dirty: 1
 
quint32 dirtyChildren: 1
 
quint32 dirtyChildrenBoundingRect: 1
 
quint32 dirtySceneTransform: 1
 
quint32 enabled: 1
 
quint32 explicitActivate: 1
 
quint32 explicitlyDisabled: 1
 
quint32 explicitlyHidden: 1
 
QList< ExtraStructextras
 
quint32 filtersDescendantEvents: 1
 
quint32 flags: 19
 
QGraphicsItemfocusProxy
 
QList< QGraphicsItem ** > focusProxyRefs
 
QGraphicsItemfocusScopeItem
 
quint32 fullUpdatePending: 1
 
quint32 geometryChanged: 1
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
int globalStackingOrder
 
QGraphicsEffectgraphicsEffect
 
quint32 handlesChildEvents: 1
 
quint32 hasBoundingRegionGranularity: 1
 
quint32 hasCursor: 1
 
quint32 holesInSiblingIndex: 1
 
quint32 ignoreOpacity: 1
 
quint32 ignoreVisible: 1
 
Qt::InputMethodHints imHints
 
quint32 inDestructor: 1
 
int index
 
quint32 inSetPosHelper: 1
 
quint32 isDeclarativeItem: 1
 
quint32 isMemberOfGroup: 1
 
quint32 isObject: 1
 
quint32 isWidget: 1
 
int itemDepth
 
quint32 itemDiscovered: 1
 
quint32 localCollisionHack: 1
 
quint32 mayHaveChildWithGraphicsEffect: 1
 
quint32 mouseSetsFocus: 1
 
quint32 needSortChildren: 1
 
QRectF needsRepaint
 
quint32 notifyBoundingRectChanged: 1
 
quint32 notifyInvalidated: 1
 
qreal opacity
 
quint32 padding: 21
 
QMap< QWidget *, QRectpaintedViewBoundingRects
 
quint32 paintedViewBoundingRectsNeedRepaint: 1
 
QGraphicsItem::PanelModality panelModality
 
QGraphicsItemparent
 
quint32 pendingPolish: 1
 
QPointF pos
 
QGraphicsItemq_ptr
 
QGraphicsScenescene
 
quint32 scenePosDescendants: 1
 
QTransform sceneTransform
 
quint32 sceneTransformTranslateOnly: 1
 
quint32 selected: 1
 
quint32 sendParentChangeNotification: 1
 
quint32 sequentialOrdering: 1
 
int siblingIndex
 
QGraphicsItemsubFocusItem
 
TransformDatatransformData
 
quint32 updateDueToGraphicsEffect: 1
 
quint32 visible: 1
 
quint32 wantsActive: 1
 
qreal z
 

Static Public Variables

static const int sectionCacheSize = 4
 
- Static Public Variables inherited from QDeclarativeItemPrivate
static qint64 consistentTime = -1
 

Additional Inherited Members

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

Detailed Description

Definition at line 190 of file qdeclarativelistview.cpp.

Enumerations

◆ BufferMode

◆ MovementReason

Constructors and Destructors

◆ QDeclarativeListViewPrivate()

QDeclarativeListViewPrivate::QDeclarativeListViewPrivate ( )
inline

Definition at line 195 of file qdeclarativelistview.cpp.

197  , visiblePos(0), visibleIndex(0)
198  , averageSize(100.0), currentIndex(-1), requestedIndex(-1)
203  , sectionCriteria(0), spacing(0.0)
209  , ownModel(false), wrap(false), autoHighlight(true), haveHighlightRange(false)
210  , correctFlick(false), inFlickCorrection(false), lazyRelease(false)
211  , deferredRelease(false), layoutScheduled(false), currentIndexCleared(false)
212  , inViewportMoved(false)
213  , minExtentDirty(true), maxExtentDirty(true)
214  {}
QDeclarativeComponent * headerComponent
QDeclarativeListView::SnapMode snapMode
QDeclarativeComponent * footerComponent
QDeclarativeComponent * highlightComponent
QDeclarativeListView::Orientation orient
QDeclarativeViewSection * sectionCriteria
QSmoothedAnimation * highlightSizeAnimator
QDeclarativeListView::HighlightRangeMode highlightRange
QSmoothedAnimation * highlightPosAnimator

Functions

◆ checkVisible()

void QDeclarativeListViewPrivate::checkVisible ( ) const
inline

Definition at line 509 of file qdeclarativelistview.cpp.

509  {
510  int skip = 0;
511  for (int i = 0; i < visibleItems.count(); ++i) {
512  FxListItem *listItem = visibleItems.at(i);
513  if (listItem->index == -1) {
514  ++skip;
515  } else if (listItem->index != visibleIndex + i - skip) {
516  qFatal("index %d %d %d", visibleIndex, i, listItem->index);
517  }
518  }
519  }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
Q_CORE_EXPORT void qFatal(const char *,...)

◆ clear()

void QDeclarativeListViewPrivate::clear ( )

Definition at line 613 of file qdeclarativelistview.cpp.

614 {
615  timeline.clear();
616  for (int i = 0; i < visibleItems.count(); ++i)
619  for (int i = 0; i < sectionCacheSize; ++i) {
620  delete sectionCache[i];
621  sectionCache[i] = 0;
622  }
623  visiblePos = header ? header->size() : 0;
624  visibleIndex = 0;
626  currentItem = 0;
627  createHighlight();
628  trackedItem = 0;
629  minExtentDirty = true;
630  maxExtentDirty = true;
631  itemCount = 0;
632 }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void clear()
Resets the timeline.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QDeclarativeItem * sectionCache[sectionCacheSize]
void clear()
Removes all items from the list.
Definition: qlist.h:764
void releaseItem(FxListItem *item)
qreal size() const

◆ createComponentItem()

QDeclarativeItem * QDeclarativeListViewPrivate::createComponentItem ( QDeclarativeComponent component)

Definition at line 681 of file qdeclarativelistview.cpp.

682 {
684  QDeclarativeItem *item = 0;
685  QDeclarativeContext *creationContext = component->creationContext();
687  creationContext ? creationContext : qmlContext(q));
688  QObject *nobj = component->create(context);
689  if (nobj) {
690  QDeclarative_setParent_noEvent(context, nobj);
691  item = qobject_cast<QDeclarativeItem *>(nobj);
692  if (!item)
693  delete nobj;
694  } else {
695  delete context;
696  }
697 
698  return item;
699 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
virtual QObject * create(QDeclarativeContext *context=0)
Create an object instance from this component.
#define Q_Q(Class)
Definition: qglobal.h:2483
The QDeclarativeItem class provides the most basic of all visual items in QML.
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
The QDeclarativeContext class defines a context within a QML engine.
QDeclarativeContext * creationContext() const
Returns the QDeclarativeContext the component was created in.

◆ createHighlight()

void QDeclarativeListViewPrivate::createHighlight ( )

Definition at line 950 of file qdeclarativelistview.cpp.

951 {
953  bool changed = false;
954  if (highlight) {
955  if (trackedItem == highlight)
956  trackedItem = 0;
957  if (highlight->item->scene())
960  delete highlight;
961  highlight = 0;
962  delete highlightPosAnimator;
963  delete highlightSizeAnimator;
966  changed = true;
967  }
968 
969  if (currentItem) {
970  QDeclarativeItem *item = 0;
971  if (highlightComponent) {
973  } else {
974  item = new QDeclarativeItem;
975  }
976  if (item) {
977  QDeclarative_setParent_noEvent(item, q->contentItem());
978  item->setParentItem(q->contentItem());
979  highlight = new FxListItem(item, q);
980  if (currentItem && autoHighlight) {
983  } else {
985  }
987  }
990  const QLatin1String posProp(orient == QDeclarativeListView::Vertical ? "y" : "x");
995  const QLatin1String sizeProp(orient == QDeclarativeListView::Vertical ? "height" : "width");
1000  if (autoHighlight) {
1003  }
1004  changed = true;
1005  }
1006  }
1007  if (changed)
1008  emit q->highlightItemChanged();
1009 }
QDeclarativeItem * createComponentItem(QDeclarativeComponent *component)
QDeclarativeComponent * highlightComponent
QDeclarativeListView::Orientation orient
#define Q_Q(Class)
Definition: qglobal.h:2483
qreal itemPosition() const
void setParentItem(QDeclarativeItem *parent)
QDeclarativeItem * item
The QDeclarativeItem class provides the most basic of all visual items in QML.
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
#define emit
Definition: qobjectdefs.h:76
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QSmoothedAnimation * highlightSizeAnimator
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
void setPosition(qreal pos)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QSmoothedAnimation * highlightPosAnimator
The QDeclarativeProperty class abstracts accessing properties on objects created from QML...
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145

◆ createItem()

FxListItem * QDeclarativeListViewPrivate::createItem ( int  modelIndex)

Definition at line 634 of file qdeclarativelistview.cpp.

635 {
637  // create object
638  requestedIndex = modelIndex;
639  FxListItem *listItem = 0;
640  if (QDeclarativeItem *item = model->item(modelIndex, false)) {
641  listItem = new FxListItem(item, q);
642  listItem->index = modelIndex;
643  // initialise attached properties
644  if (sectionCriteria) {
645  QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
646  listItem->attached->m_section = sectionCriteria->sectionString(propValue);
647  if (modelIndex > 0) {
648  if (FxListItem *item = itemBefore(modelIndex))
649  listItem->attached->m_prevSection = item->attached->section();
650  else
651  listItem->attached->m_prevSection = sectionAt(modelIndex-1);
652  }
653  if (modelIndex < model->count()-1) {
654  if (FxListItem *item = visibleItem(modelIndex+1))
655  listItem->attached->m_nextSection = item->attached->section();
656  else
657  listItem->attached->m_nextSection = sectionAt(modelIndex+1);
658  }
659  }
660  if (model->completePending()) {
661  // complete
662  listItem->item->setZValue(1);
663  listItem->item->setParentItem(q->contentItem());
664  model->completeItem();
665  } else {
666  listItem->item->setParentItem(q->contentItem());
667  }
671  if (listItem->attached->m_prevSection != listItem->attached->m_section)
672  createSection(listItem);
673  }
674  unrequestedItems.remove(listItem->item);
675  }
676  requestedIndex = -1;
677 
678  return listItem;
679 }
QString section(QChar sep, int start, int end=-1, SectionFlags flags=SectionDefault) const
This function returns a section of the string.
Definition: qstring.h:781
QDeclarativeComponent * delegate
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
virtual bool completePending() const =0
FxListItem * itemBefore(int modelIndex) const
virtual QString stringValue(int, const QString &)=0
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
void setParentItem(QDeclarativeItem *parent)
void setZValue(qreal z)
Sets the Z-value of the item to z.
QDeclarativeItem * item
The QDeclarativeItem class provides the most basic of all visual items in QML.
QDeclarativeListViewAttached * attached
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
QDeclarativeGuard< QDeclarativeVisualModel > model
QDeclarativeViewSection * sectionCriteria
FxListItem * visibleItem(int modelIndex) const
QHash< QDeclarativeItem *, int > unrequestedItems
virtual QDeclarativeItem * item(int index, bool complete=true)=0
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QString sectionString(const QString &value)
virtual void completeItem()=0
QString sectionAt(int modelIndex)

◆ createSection()

void QDeclarativeListViewPrivate::createSection ( FxListItem listItem)

Definition at line 1034 of file qdeclarativelistview.cpp.

1035 {
1038  return;
1039  if (listItem->attached->m_prevSection != listItem->attached->m_section) {
1040  if (!listItem->section) {
1041  qreal pos = listItem->position();
1042  int i = sectionCacheSize-1;
1043  while (i >= 0 && !sectionCache[i])
1044  --i;
1045  if (i >= 0) {
1046  listItem->section = sectionCache[i];
1047  sectionCache[i] = 0;
1048  listItem->section->setVisible(true);
1050  context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
1051  } else {
1053  context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
1054  QObject *nobj = sectionCriteria->delegate()->beginCreate(context);
1055  if (nobj) {
1056  QDeclarative_setParent_noEvent(context, nobj);
1057  listItem->section = qobject_cast<QDeclarativeItem *>(nobj);
1058  if (!listItem->section) {
1059  delete nobj;
1060  } else {
1061  listItem->section->setZValue(1);
1062  QDeclarative_setParent_noEvent(listItem->section, q->contentItem());
1063  listItem->section->setParentItem(q->contentItem());
1064  }
1065  } else {
1066  delete context;
1067  }
1069  }
1070  listItem->setPosition(pos);
1071  } else {
1073  context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
1074  }
1075  } else if (listItem->section) {
1076  qreal pos = listItem->position();
1077  int i = 0;
1078  do {
1079  if (!sectionCache[i]) {
1080  sectionCache[i] = listItem->section;
1081  sectionCache[i]->setVisible(false);
1082  listItem->section = 0;
1083  return;
1084  }
1085  ++i;
1086  } while (i < sectionCacheSize);
1087  delete listItem->section;
1088  listItem->section = 0;
1089  listItem->setPosition(pos);
1090  }
1091 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
QDeclarativeComponent * delegate
double qreal
Definition: qglobal.h:1193
QDeclarativeContext * parentContext() const
Return the context&#39;s parent QDeclarativeContext, or 0 if this context has no parent or if the parent ...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
void setVisible(bool visible)
If visible is true, the item is made visible.
#define Q_Q(Class)
Definition: qglobal.h:2483
void setParentItem(QDeclarativeItem *parent)
void setZValue(qreal z)
Sets the Z-value of the item to z.
The QDeclarativeItem class provides the most basic of all visual items in QML.
QDeclarativeListViewAttached * attached
QDeclarativeItem * sectionCache[sectionCacheSize]
virtual QObject * beginCreate(QDeclarativeContext *)
This method provides more advanced control over component instance creation.
QDeclarativeViewSection * sectionCriteria
void setContextProperty(const QString &, QObject *)
Set the value of the name property on this context.
qreal position() const
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
void setPosition(qreal pos)
The QDeclarativeContext class defines a context within a QML engine.
static QDeclarativeContext * contextForObject(const QObject *)
Returns the QDeclarativeContext for the object, or 0 if no context has been set.
QDeclarativeItem * section
virtual void completeCreate()
This method provides more advanced control over component instance creation.

◆ endPosition()

qreal QDeclarativeListViewPrivate::endPosition ( ) const
inline

Definition at line 350 of file qdeclarativelistview.cpp.

◆ endPositionAt()

qreal QDeclarativeListViewPrivate::endPositionAt ( int  modelIndex) const
inline

Definition at line 382 of file qdeclarativelistview.cpp.

382  {
383  if (FxListItem *item = visibleItem(modelIndex))
384  return item->endPosition();
385  if (!visibleItems.isEmpty()) {
386  if (modelIndex < visibleIndex) {
387  int count = visibleIndex - modelIndex;
388  return (*visibleItems.constBegin())->position() - (count - 1) * (averageSize + spacing) - spacing - 1;
389  } else {
390  int idx = visibleItems.count() - 1;
391  while (idx >= 0 && visibleItems.at(idx)->index == -1)
392  --idx;
393  if (idx < 0)
394  idx = visibleIndex;
395  else
396  idx = visibleItems.at(idx)->index;
397  int count = modelIndex - idx - 1;
398  return (*(--visibleItems.constEnd()))->endPosition() + count * (averageSize + spacing);
399  }
400  }
401  return 0;
402  }
QList< FxListItem * > visibleItems
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
FxListItem * visibleItem(int modelIndex) const
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ firstVisibleItem()

FxListItem* QDeclarativeListViewPrivate::firstVisibleItem ( ) const
inline

Definition at line 233 of file qdeclarativelistview.cpp.

233  {
234  const qreal pos = isRightToLeft() ? -position()-size() : position();
235  for (int i = 0; i < visibleItems.count(); ++i) {
236  FxListItem *item = visibleItems.at(i);
237  if (item->index != -1 && item->endPosition() > pos)
238  return item;
239  }
240  return visibleItems.count() ? visibleItems.first() : 0;
241  }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
qreal endPosition() const
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282

◆ fixup()

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

Reimplemented from QDeclarativeFlickablePrivate.

Definition at line 1283 of file qdeclarativelistview.cpp.

1284 {
1287  return;
1288 
1289  correctFlick = false;
1292 
1293  qreal highlightStart;
1294  qreal highlightEnd;
1295  qreal viewPos;
1296  if (isRightToLeft()) {
1297  // Handle Right-To-Left exceptions
1298  viewPos = -position()-size();
1301  } else {
1302  viewPos = position();
1303  highlightStart = highlightRangeStart;
1304  highlightEnd = highlightRangeEnd;
1305  }
1306 
1308  qreal tempPosition = isRightToLeft() ? -position()-size() : position();
1310  // if we've been dragged < averageSize/2 then bias towards the next item
1311  qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
1312  qreal bias = 0;
1313  if (data.velocity > 0 && dist > QML_FLICK_SNAPONETHRESHOLD && dist < averageSize/2)
1314  bias = averageSize/2;
1315  else if (data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -averageSize/2)
1316  bias = -averageSize/2;
1317  if (isRightToLeft())
1318  bias = -bias;
1319  tempPosition -= bias;
1320  }
1321  FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
1322  if (!topItem && strictHighlightRange && currentItem) {
1323  // StrictlyEnforceRange always keeps an item in range
1324  updateHighlight();
1325  topItem = currentItem;
1326  }
1327  FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
1328  if (!bottomItem && strictHighlightRange && currentItem) {
1329  // StrictlyEnforceRange always keeps an item in range
1330  updateHighlight();
1331  bottomItem = currentItem;
1332  }
1333  qreal pos;
1334  bool isInBounds = -position() > maxExtent && -position() <= minExtent;
1335  if (topItem && (isInBounds || strictHighlightRange)) {
1336  if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2 && !strictHighlightRange) {
1337  pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
1338  } else {
1339  if (isRightToLeft())
1340  pos = qMax(qMin(-topItem->position() + highlightStart - size(), -maxExtent), -minExtent);
1341  else
1342  pos = qMax(qMin(topItem->position() - highlightStart, -maxExtent), -minExtent);
1343  }
1344  } else if (bottomItem && isInBounds) {
1345  if (isRightToLeft())
1346  pos = qMax(qMin(-bottomItem->position() + highlightEnd - size(), -maxExtent), -minExtent);
1347  else
1348  pos = qMax(qMin(bottomItem->position() - highlightEnd, -maxExtent), -minExtent);
1349  } else {
1351  return;
1352  }
1353 
1354  qreal dist = qAbs(data.move + pos);
1355  if (dist > 0) {
1356  timeline.reset(data.move);
1357  if (fixupMode != Immediate) {
1359  data.fixingUp = true;
1360  } else {
1361  timeline.set(data.move, -pos);
1362  }
1363  vTime = timeline.time();
1364  }
1365  } else if (currentItem && strictHighlightRange
1367  updateHighlight();
1368  qreal pos = currentItem->itemPosition();
1369  if (viewPos < pos + currentItem->itemSize() - highlightEnd)
1370  viewPos = pos + currentItem->itemSize() - highlightEnd;
1371  if (viewPos > pos - highlightStart)
1372  viewPos = pos - highlightStart;
1373  if (isRightToLeft())
1374  viewPos = -viewPos-size();
1375 
1376  timeline.reset(data.move);
1377  if (viewPos != position()) {
1378  if (fixupMode != Immediate) {
1380  data.fixingUp = true;
1381  } else {
1382  timeline.set(data.move, -viewPos);
1383  }
1384  }
1385  vTime = timeline.time();
1386  } else {
1388  }
1389  data.inOvershoot = false;
1390  fixupMode = Normal;
1391 }
FxListItem * snapItemAt(qreal pos)
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeListView::SnapMode snapMode
The QEasingCurve class provides easing curves for controlling animation.
Definition: qeasingcurve.h:55
void move(QDeclarativeTimeLineValue &, qreal destination, int time=500)
Linearly change the timeLineValue from its current value to the given destination value over time mil...
void reset(QDeclarativeTimeLineValue &)
Cancel (but don&#39;t complete) all scheduled actions for timeLineValue.
QDeclarativeListView::Orientation orient
#define QML_FLICK_SNAPONETHRESHOLD
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
qreal itemPosition() const
qreal itemSize() const
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
void set(QDeclarativeTimeLineValue &, qreal)
Set the value of timeLineValue.
qreal position() const
QDeclarativeListView::HighlightRangeMode highlightRange
qreal size() const
QDeclarativeListProperty< QObject > data()

◆ fixupPosition()

void QDeclarativeListViewPrivate::fixupPosition ( )

◆ flick()

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

Reimplemented from QDeclarativeFlickablePrivate.

Definition at line 1393 of file qdeclarativelistview.cpp.

1395 {
1397 
1398  data.fixingUp = false;
1399  moveReason = Mouse;
1401  correctFlick = true;
1402  QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
1403  return;
1404  }
1405  qreal maxDistance = 0;
1406  qreal dataValue = isRightToLeft() ? -data.move.value()+size() : data.move.value();
1408  // -ve velocity means list is moving up/left
1409  if (velocity > 0) {
1410  if (data.move.value() < minExtent) {
1412  // if we've been dragged < averageSize/2 then bias towards the next item
1413  qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
1414  qreal bias = dist < averageSize/2 ? averageSize/2 : 0;
1415  if (isRightToLeft())
1416  bias = -bias;
1417  data.flickTarget = -snapPosAt(-(dataValue - highlightStart) - bias) + highlightStart;
1418  maxDistance = qAbs(data.flickTarget - data.move.value());
1419  velocity = maxVelocity;
1420  } else {
1421  maxDistance = qAbs(minExtent - data.move.value());
1422  }
1423  }
1425  data.flickTarget = minExtent;
1426  } else {
1427  if (data.move.value() > maxExtent) {
1429  // if we've been dragged < averageSize/2 then bias towards the next item
1430  qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
1431  qreal bias = -dist < averageSize/2 ? averageSize/2 : 0;
1432  if (isRightToLeft())
1433  bias = -bias;
1434  data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + bias) + highlightStart;
1435  maxDistance = qAbs(data.flickTarget - data.move.value());
1436  velocity = -maxVelocity;
1437  } else {
1438  maxDistance = qAbs(maxExtent - data.move.value());
1439  }
1440  }
1442  data.flickTarget = maxExtent;
1443  }
1444 
1446 
1447  if (maxDistance > 0 || overShoot) {
1448  // These modes require the list to stop exactly on an item boundary.
1449  // The initial flick will estimate the boundary to stop on.
1450  // Since list items can have variable sizes, the boundary will be
1451  // reevaluated and adjusted as we approach the boundary.
1452  qreal v = velocity;
1453  if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
1454  if (v < 0)
1455  v = -maxVelocity;
1456  else
1457  v = maxVelocity;
1458  }
1459  if (!hData.flicking && !vData.flicking) {
1460  // the initial flick - estimate boundary
1461  qreal accel = deceleration;
1462  qreal v2 = v * v;
1463  overshootDist = qreal(0.0);
1464  // + averageSize/4 to encourage moving at least one item in the flick direction
1465  qreal dist = v2 / (accel * qreal(2.0)) + averageSize/4;
1466  if (maxDistance > 0)
1467  dist = qMin(dist, maxDistance);
1468  if (v > 0)
1469  dist = -dist;
1470  if ((maxDistance > qreal(0.0) && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) {
1472  qreal distTemp = isRightToLeft() ? -dist : dist;
1473  data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
1474  }
1475  data.flickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
1476  if (overShoot) {
1477  if (data.flickTarget >= minExtent) {
1479  data.flickTarget += overshootDist;
1480  } else if (data.flickTarget <= maxExtent) {
1482  data.flickTarget -= overshootDist;
1483  }
1484  }
1485  qreal adjDist = -data.flickTarget + data.move.value();
1486  if (qAbs(adjDist) > qAbs(dist)) {
1487  // Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
1488  qreal adjv2 = accel * 2.0f * qAbs(adjDist);
1489  if (adjv2 > v2) {
1490  v2 = adjv2;
1491  v = qSqrt(v2);
1492  if (dist > 0)
1493  v = -v;
1494  }
1495  }
1496  dist = adjDist;
1497  accel = v2 / (2.0f * qAbs(dist));
1498  } else if (overShoot) {
1499  data.flickTarget = data.move.value() - dist;
1500  if (data.flickTarget >= minExtent) {
1502  data.flickTarget += overshootDist;
1503  } else if (data.flickTarget <= maxExtent) {
1505  data.flickTarget -= overshootDist;
1506  }
1507  }
1508 
1509  timeline.reset(data.move);
1510  timeline.accel(data.move, v, accel, maxDistance + overshootDist);
1511  timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
1512  if (!hData.flicking && q->xflick()) {
1513  hData.flicking = true;
1514  emit q->flickingChanged();
1515  emit q->flickingHorizontallyChanged();
1516  emit q->flickStarted();
1517  }
1518  if (!vData.flicking && q->yflick()) {
1519  vData.flicking = true;
1520  emit q->flickingChanged();
1521  emit q->flickingVerticallyChanged();
1522  emit q->flickStarted();
1523  }
1524  correctFlick = true;
1525  } else {
1526  // reevaluate the target boundary.
1527  qreal newtarget = data.flickTarget;
1529  qreal tempFlickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
1530  newtarget = -snapPosAt(-(tempFlickTarget - highlightStart)) + highlightStart;
1531  newtarget = isRightToLeft() ? -newtarget+size() : newtarget;
1532  }
1533  if (velocity < 0 && newtarget <= maxExtent)
1534  newtarget = maxExtent - overshootDist;
1535  else if (velocity > 0 && newtarget >= minExtent)
1536  newtarget = minExtent + overshootDist;
1537  if (newtarget == data.flickTarget) { // boundary unchanged - nothing to do
1538  if (qAbs(velocity) < MinimumFlickVelocity)
1539  correctFlick = false;
1540  return;
1541  }
1542  data.flickTarget = newtarget;
1543  qreal dist = -newtarget + data.move.value();
1544  if ((v < 0 && dist < 0) || (v > 0 && dist > 0)) {
1545  correctFlick = false;
1546  timeline.reset(data.move);
1547  fixup(data, minExtent, maxExtent);
1548  return;
1549  }
1550 
1551  timeline.reset(data.move);
1552  timeline.accelDistance(data.move, v, -dist);
1553  timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
1554  }
1555  } else {
1556  correctFlick = false;
1557  timeline.reset(data.move);
1558  fixup(data, minExtent, maxExtent);
1559  }
1560 }
int accelDistance(QDeclarativeTimeLineValue &, qreal velocity, qreal distance)
Decelerate timeLineValue from the starting velocity to zero over the given distance.
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QDeclarativeListView::SnapMode snapMode
int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel)
Decelerate timeLineValue from the starting velocity to zero at the given acceleration rate...
void reset(QDeclarativeTimeLineValue &)
Cancel (but don&#39;t complete) all scheduled actions for timeLineValue.
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_Q(Class)
Definition: qglobal.h:2483
const qreal MinimumFlickVelocity
virtual qreal value() const
Return the current value.
#define emit
Definition: qobjectdefs.h:76
virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent)
QDeclarativeTimeLineValueProxy< QDeclarativeFlickablePrivate > move
QDeclarativeListView::HighlightRangeMode highlightRange
virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
qreal qSqrt(qreal v)
Definition: qmath.h:205
void callback(const QDeclarativeTimeLineCallback &)
Execute the event.
QDeclarativeFlickable::BoundsBehavior boundsBehavior

◆ init()

void QDeclarativeListViewPrivate::init ( )

Definition at line 603 of file qdeclarativelistview.cpp.

604 {
608  QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped()));
609  q->setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
610  ::memset(sectionCache, 0, sizeof(QDeclarativeItem*) * sectionCacheSize);
611 }
#define SLOT(a)
Definition: qobjectdefs.h:226
#define Q_Q(Class)
Definition: qglobal.h:2483
#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
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
QDeclarativeItem * sectionCache[sectionCacheSize]

◆ isRightToLeft()

bool QDeclarativeListViewPrivate::isRightToLeft ( ) const
inline

Definition at line 293 of file qdeclarativelistview.cpp.

293  {
294  Q_Q(const QDeclarativeListView);
295  return orient == QDeclarativeListView::Horizontal && q->effectiveLayoutDirection() == Qt::RightToLeft;
296  }
QDeclarativeListView::Orientation orient
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ isValid()

bool QDeclarativeListViewPrivate::isValid ( ) const
inline

Definition at line 417 of file qdeclarativelistview.cpp.

417  {
418  return model && model->count() && model->isValid();
419  }
virtual bool isValid() const =0
QDeclarativeGuard< QDeclarativeVisualModel > model

◆ itemBefore()

FxListItem* QDeclarativeListViewPrivate::itemBefore ( int  modelIndex) const
inline

Definition at line 245 of file qdeclarativelistview.cpp.

245  {
246  if (modelIndex < visibleIndex)
247  return 0;
248  int idx = 1;
249  int lastIndex = -1;
250  while (idx < visibleItems.count()) {
251  FxListItem *item = visibleItems.at(idx);
252  if (item->index != -1)
253  lastIndex = item->index;
254  if (item->index == modelIndex)
255  return visibleItems.at(idx-1);
256  ++idx;
257  }
258  if (lastIndex == modelIndex-1)
259  return visibleItems.last();
260  return 0;
261  }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284

◆ itemGeometryChanged()

void QDeclarativeListViewPrivate::itemGeometryChanged ( QDeclarativeItem item,
const QRectF newGeometry,
const QRectF oldGeometry 
)
inlinevirtual

Reimplemented from QDeclarativeFlickablePrivate.

Definition at line 485 of file qdeclarativelistview.cpp.

485  {
487  QDeclarativeFlickablePrivate::itemGeometryChanged(item, newGeometry, oldGeometry);
488  if (!q->isComponentComplete())
489  return;
490  if (item != contentItem && (!highlight || item != highlight->item)) {
491  if ((orient == QDeclarativeListView::Vertical && newGeometry.height() != oldGeometry.height())
492  || (orient == QDeclarativeListView::Horizontal && newGeometry.width() != oldGeometry.width())) {
493  scheduleLayout();
494  }
495  }
496  if ((header && header->item == item) || (footer && footer->item == item)) {
497  if (header)
498  updateHeader();
499  if (footer)
500  updateFooter();
501  }
502  if (currentItem && currentItem->item == item)
503  updateHighlight();
504  if (trackedItem && trackedItem->item == item)
505  q->trackedPositionChanged();
506  }
QDeclarativeListView::Orientation orient
void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &)
#define Q_Q(Class)
Definition: qglobal.h:2483
QDeclarativeItem * item
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707

◆ lastPosition()

qreal QDeclarativeListViewPrivate::lastPosition ( ) const
inline

Definition at line 329 of file qdeclarativelistview.cpp.

329  {
330  qreal pos = 0;
331  if (!visibleItems.isEmpty()) {
332  int invisibleCount = visibleItems.count() - visibleIndex;
333  for (int i = visibleItems.count()-1; i >= 0; --i) {
334  if (visibleItems.at(i)->index != -1) {
335  invisibleCount = model->count() - visibleItems.at(i)->index - 1;
336  break;
337  }
338  }
339  pos = (*(--visibleItems.constEnd()))->endPosition() + invisibleCount * (averageSize + spacing);
340  } else if (model && model->count()) {
341  pos = model->count() * averageSize + (model->count()-1) * spacing;
342  }
343  return pos;
344  }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QDeclarativeGuard< QDeclarativeVisualModel > model
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ lastVisibleIndex()

int QDeclarativeListViewPrivate::lastVisibleIndex ( ) const
inline

Definition at line 450 of file qdeclarativelistview.cpp.

450  {
451  int lastIndex = -1;
452  for (int i = visibleItems.count()-1; i >= 0; --i) {
453  FxListItem *listItem = visibleItems.at(i);
454  if (listItem->index != -1) {
455  lastIndex = listItem->index;
456  break;
457  }
458  }
459  return lastIndex;
460  }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468

◆ layout()

void QDeclarativeListViewPrivate::layout ( )

Definition at line 866 of file qdeclarativelistview.cpp.

867 {
869  layoutScheduled = false;
870  if (!isValid() && !visibleItems.count()) {
871  clear();
872  setPosition(0);
873  return;
874  }
875  if (!visibleItems.isEmpty()) {
876  bool fixedCurrent = currentItem && visibleItems.first()->item == currentItem->item;
877  qreal sum = visibleItems.first()->size();
879  for (int i=1; i < visibleItems.count(); ++i) {
880  FxListItem *item = visibleItems.at(i);
881  item->setPosition(pos);
882  pos += item->size() + spacing;
883  sum += item->size();
884  fixedCurrent = fixedCurrent || (currentItem && item->item == currentItem->item);
885  }
887  // move current item if it is not a visible item.
888  if (currentIndex >= 0 && currentItem && !fixedCurrent)
890  }
891  q->refill();
892  minExtentDirty = true;
893  maxExtentDirty = true;
894  updateHighlight();
895  if (!q->isMoving() && !q->isFlicking()) {
896  fixupPosition();
897  q->refill();
898  }
899  if (sectionCriteria)
901  if (header)
902  updateHeader();
903  if (footer)
904  updateFooter();
905  updateViewport();
906 }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
qreal positionAt(int modelIndex) const
QDeclarativeItem * item
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QDeclarativeViewSection * sectionCriteria
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
qreal position() const
void setPosition(qreal pos)
qreal size() const
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ mapFromModel()

int QDeclarativeListViewPrivate::mapFromModel ( int  modelIndex) const
inline

Definition at line 463 of file qdeclarativelistview.cpp.

463  {
464  if (modelIndex < visibleIndex || modelIndex >= visibleIndex + visibleItems.count())
465  return -1;
466  for (int i = 0; i < visibleItems.count(); ++i) {
467  FxListItem *listItem = visibleItems.at(i);
468  if (listItem->index == modelIndex)
469  return i;
470  if (listItem->index > modelIndex)
471  return -1;
472  }
473  return -1; // Not in visibleList
474  }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468

◆ mirrorChange()

void QDeclarativeListViewPrivate::mirrorChange ( )
inlinevirtual

Reimplemented from QDeclarativeItemPrivate.

Definition at line 289 of file qdeclarativelistview.cpp.

289  {
290  regenerate();
291  }

◆ originPosition()

qreal QDeclarativeListViewPrivate::originPosition ( ) const
inline

Definition at line 319 of file qdeclarativelistview.cpp.

319  {
320  qreal pos = 0;
321  if (!visibleItems.isEmpty()) {
322  pos = (*visibleItems.constBegin())->position();
323  if (visibleIndex > 0)
324  pos -= visibleIndex * (averageSize + spacing);
325  }
326  return pos;
327  }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152

◆ position()

qreal QDeclarativeListViewPrivate::position ( ) const
inline

Definition at line 298 of file qdeclarativelistview.cpp.

298  {
299  Q_Q(const QDeclarativeListView);
300  return orient == QDeclarativeListView::Vertical ? q->contentY() : q->contentX();
301  }
QDeclarativeListView::Orientation orient
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ positionAt()

qreal QDeclarativeListViewPrivate::positionAt ( int  modelIndex) const
inline

Definition at line 354 of file qdeclarativelistview.cpp.

354  {
355  if (FxListItem *item = visibleItem(modelIndex))
356  return item->position();
357  if (!visibleItems.isEmpty()) {
358  if (modelIndex < visibleIndex) {
359  int count = visibleIndex - modelIndex;
360  qreal cs = 0;
361  if (modelIndex == currentIndex && currentItem) {
362  cs = currentItem->size() + spacing;
363  --count;
364  }
365  return (*visibleItems.constBegin())->position() - count * (averageSize + spacing) - cs;
366  } else {
367  int idx = visibleItems.count() - 1;
368  while (idx >= 0 && visibleItems.at(idx)->index == -1)
369  --idx;
370  if (idx < 0)
371  idx = visibleIndex;
372  else
373  idx = visibleItems.at(idx)->index;
374  int count = modelIndex - idx - 1;
375 
376  return (*(--visibleItems.constEnd()))->endPosition() + spacing + count * (averageSize + spacing) + 1;
377  }
378  }
379  return 0;
380  }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
FxListItem * visibleItem(int modelIndex) const
qreal size() const
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ positionViewAtIndex()

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

Definition at line 2999 of file qdeclarativelistview.cpp.

3000 {
3002  if (!isValid())
3003  return;
3004  if (mode < QDeclarativeListView::Beginning || mode > QDeclarativeListView::Contain)
3005  return;
3006  int idx = qMax(qMin(index, model->count()-1), 0);
3007 
3008  if (layoutScheduled)
3009  layout();
3010  qreal pos = isRightToLeft() ? -position() - size() : position();
3011  FxListItem *item = visibleItem(idx);
3012  qreal maxExtent;
3014  maxExtent = -q->maxYExtent();
3015  else
3016  maxExtent = isRightToLeft() ? q->minXExtent()-size(): -q->maxXExtent();
3017 
3018  if (!item) {
3019  int itemPos = positionAt(idx);
3020  // save the currently visible items in case any of them end up visible again
3021  QList<FxListItem*> oldVisible = visibleItems;
3022  visibleItems.clear();
3023  visiblePos = itemPos;
3024  visibleIndex = idx;
3025  setPosition(qMin(qreal(itemPos), maxExtent));
3026  // now release the reference to all the old visible items.
3027  for (int i = 0; i < oldVisible.count(); ++i)
3028  releaseItem(oldVisible.at(i));
3029  item = visibleItem(idx);
3030  }
3031  if (item) {
3032  const qreal itemPos = item->position();
3033  switch (mode) {
3035  pos = itemPos;
3036  if (index < 0 && header)
3037  pos -= header->size();
3038  break;
3040  pos = itemPos - (size() - item->size())/2;
3041  break;
3043  pos = itemPos - size() + item->size();
3044  if (index >= model->count() && footer)
3045  pos += footer->size();
3046  break;
3048  if (itemPos > pos + size())
3049  pos = itemPos - size() + item->size();
3050  else if (item->endPosition() < pos)
3051  pos = itemPos;
3052  break;
3054  if (item->endPosition() > pos + size())
3055  pos = itemPos - size() + item->size();
3056  if (itemPos < pos)
3057  pos = itemPos;
3058  }
3059  pos = qMin(pos, maxExtent);
3060  qreal minExtent;
3062  minExtent = -q->minYExtent();
3063  } else {
3064  minExtent = isRightToLeft() ? q->maxXExtent()-size(): -q->minXExtent();
3065  }
3066  pos = qMax(pos, minExtent);
3068  q->cancelFlick();
3069  setPosition(pos);
3070  if (highlight) {
3071  if (autoHighlight) {
3074  }
3075  updateHighlight();
3076  }
3077  }
3078  fixupPosition();
3079 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QDeclarativeListView::Orientation orient
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
qreal itemPosition() const
qreal positionAt(int modelIndex) const
qreal itemSize() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QDeclarativeGuard< QDeclarativeVisualModel > model
void clear()
Removes all items from the list.
Definition: qlist.h:764
FxListItem * visibleItem(int modelIndex) const
qreal endPosition() const
void setSize(qreal size)
qreal position() const
void setPosition(qreal pos)
void releaseItem(FxListItem *item)
qreal size() const
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ refill()

void QDeclarativeListViewPrivate::refill ( qreal  from,
qreal  to,
bool  doBuffer = false 
)

Definition at line 730 of file qdeclarativelistview.cpp.

731 {
733  if (!isValid() || !q->isComponentComplete())
734  return;
735  itemCount = model->count();
736  qreal bufferFrom = from - buffer;
737  qreal bufferTo = to + buffer;
738  qreal fillFrom = from;
739  qreal fillTo = to;
740  if (doBuffer && (bufferMode & BufferAfter))
741  fillTo = bufferTo;
742  if (doBuffer && (bufferMode & BufferBefore))
743  fillFrom = bufferFrom;
744 
745  bool haveValidItems = false;
746  int modelIndex = visibleIndex;
747  qreal itemEnd = visiblePos-1;
748  if (!visibleItems.isEmpty()) {
750  itemEnd = (*(--visibleItems.constEnd()))->endPosition() + spacing;
751  int i = visibleItems.count() - 1;
752  while (i > 0 && visibleItems.at(i)->index == -1)
753  --i;
754  if (visibleItems.at(i)->index != -1) {
755  haveValidItems = true;
756  modelIndex = visibleItems.at(i)->index + 1;
757  }
758  }
759 
760  if (haveValidItems && (fillFrom > itemEnd+averageSize+spacing
761  || fillTo < visiblePos - averageSize - spacing)) {
762  // We've jumped more than a page. Estimate which items are now
763  // visible and fill from there.
764  int count = (fillFrom - itemEnd) / (averageSize + spacing);
765  for (int i = 0; i < visibleItems.count(); ++i)
768  modelIndex += count;
769  if (modelIndex >= model->count()) {
770  count -= modelIndex - model->count() + 1;
771  modelIndex = model->count() - 1;
772  } else if (modelIndex < 0) {
773  count -= modelIndex;
774  modelIndex = 0;
775  }
776  visibleIndex = modelIndex;
777  visiblePos = itemEnd + count * (averageSize + spacing) + 1;
778  itemEnd = visiblePos-1;
779  }
780 
781  bool changed = false;
782  FxListItem *item = 0;
783  qreal pos = itemEnd + 1;
784  while (modelIndex < model->count() && pos <= fillTo) {
785 // qDebug() << "refill: append item" << modelIndex << "pos" << pos;
786  if (!(item = createItem(modelIndex)))
787  break;
788  item->setPosition(pos);
789  pos += item->size() + spacing;
790  visibleItems.append(item);
791  ++modelIndex;
792  changed = true;
793  if (doBuffer) // never buffer more than one item per frame
794  break;
795  }
796  while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos-1 >= fillFrom) {
797 // qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos;
798  if (!(item = createItem(visibleIndex-1)))
799  break;
800  --visibleIndex;
801  visiblePos -= item->size() + spacing;
802  item->setPosition(visiblePos);
803  visibleItems.prepend(item);
804  changed = true;
805  if (doBuffer) // never buffer more than one item per frame
806  break;
807  }
808 
809  if (!lazyRelease || !changed || deferredRelease) { // avoid destroying items in the same frame that we create
810  while (visibleItems.count() > 1 && (item = visibleItems.first()) && item->endPosition() < bufferFrom) {
811  if (item->attached->delayRemove())
812  break;
813 // qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
814  if (item->index != -1)
815  visibleIndex++;
817  releaseItem(item);
818  changed = true;
819  }
820  while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->position() > bufferTo) {
821  if (item->attached->delayRemove())
822  break;
823 // qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position();
825  releaseItem(item);
826  changed = true;
827  }
828  deferredRelease = false;
829  } else {
830  deferredRelease = true;
831  }
832  if (changed) {
833  minExtentDirty = true;
834  maxExtentDirty = true;
835  if (visibleItems.count())
837  updateAverage();
840  updateHighlight();
841  }
842 
843  if (sectionCriteria)
845  if (header)
846  updateHeader();
847  if (footer)
848  updateFooter();
849  updateViewport();
851  } else if (!doBuffer && buffer && bufferMode != NoBuffer) {
852  refill(from, to, true);
853  }
854  lazyRelease = false;
855 }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
void removeLast()
Removes the last item in the list.
Definition: qlist.h:287
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
qreal positionAt(int modelIndex) const
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QDeclarativeListViewAttached * attached
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void removeFirst()
Removes the first item in the list.
Definition: qlist.h:286
QDeclarativeGuard< QDeclarativeVisualModel > model
QDeclarativeViewSection * sectionCriteria
void clear()
Removes all items from the list.
Definition: qlist.h:764
FxListItem * visibleItem(int modelIndex) const
qreal endPosition() const
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
FxListItem * createItem(int modelIndex)
qreal position() const
void setPosition(qreal pos)
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
void releaseItem(FxListItem *item)
void refill(qreal from, qreal to, bool doBuffer=false)
qreal size() const
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ regenerate()

void QDeclarativeListViewPrivate::regenerate ( )
inline

Definition at line 263 of file qdeclarativelistview.cpp.

263  {
265  if (q->isComponentComplete()) {
266  if (header) {
267  if (q->scene())
268  q->scene()->removeItem(header->item);
269  header->item->deleteLater();
270  delete header;
271  header = 0;
272  }
273  if (footer) {
274  if (q->scene())
275  q->scene()->removeItem(footer->item);
276  footer->item->deleteLater();
277  delete footer;
278  footer = 0;
279  }
280  updateHeader();
281  updateFooter();
282  clear();
283  setPosition(0);
284  q->refill();
286  }
287  }
#define Q_Q(Class)
Definition: qglobal.h:2483
QDeclarativeItem * item
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145

◆ releaseItem()

void QDeclarativeListViewPrivate::releaseItem ( FxListItem item)

Definition at line 701 of file qdeclarativelistview.cpp.

702 {
704  if (!item || !model)
705  return;
706  if (trackedItem == item)
707  trackedItem = 0;
710  if (model->release(item->item) == 0) {
711  // item was not destroyed, and we no longer reference it.
712  unrequestedItems.insert(item->item, model->indexOf(item->item, q));
713  }
714  if (item->section) {
715  int i = 0;
716  do {
717  if (!sectionCache[i]) {
718  sectionCache[i] = item->section;
719  sectionCache[i]->setVisible(false);
720  item->section = 0;
721  break;
722  }
723  ++i;
724  } while (i < sectionCacheSize);
725  delete item->section;
726  }
727  delete item;
728 }
virtual ReleaseFlags release(QDeclarativeItem *item)=0
virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const =0
void setVisible(bool visible)
If visible is true, the item is made visible.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
#define Q_Q(Class)
Definition: qglobal.h:2483
QDeclarativeItem * item
QDeclarativeItem * sectionCache[sectionCacheSize]
QDeclarativeGuard< QDeclarativeVisualModel > model
QHash< QDeclarativeItem *, int > unrequestedItems
void removeItemChangeListener(QDeclarativeItemChangeListener *, ChangeTypes types)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QDeclarativeItem * section

◆ scheduleLayout()

void QDeclarativeListViewPrivate::scheduleLayout ( )

Definition at line 857 of file qdeclarativelistview.cpp.

858 {
860  if (!layoutScheduled) {
861  layoutScheduled = true;
863  }
864 }
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
#define Q_Q(Class)
Definition: qglobal.h:2483
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ sectionAt()

QString QDeclarativeListViewPrivate::sectionAt ( int  modelIndex)
inline

Definition at line 404 of file qdeclarativelistview.cpp.

404  {
405  if (FxListItem *item = visibleItem(modelIndex))
406  return item->attached->section();
407 
408  QString section;
409  if (sectionCriteria) {
410  QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
411  section = sectionCriteria->sectionString(propValue);
412  }
413 
414  return section;
415  }
virtual QString stringValue(int, const QString &)=0
The QString class provides a Unicode character string.
Definition: qstring.h:83
QDeclarativeGuard< QDeclarativeVisualModel > model
QDeclarativeViewSection * sectionCriteria
FxListItem * visibleItem(int modelIndex) const
QString sectionString(const QString &value)

◆ setPosition()

void QDeclarativeListViewPrivate::setPosition ( qreal  pos)
inline

Definition at line 303 of file qdeclarativelistview.cpp.

303  {
306  q->QDeclarativeFlickable::setContentY(pos);
307  } else {
308  if (isRightToLeft())
309  q->QDeclarativeFlickable::setContentX(-pos-size());
310  else
311  q->QDeclarativeFlickable::setContentX(pos);
312  }
313  }
QDeclarativeListView::Orientation orient
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ size()

qreal QDeclarativeListViewPrivate::size ( ) const
inline

Definition at line 314 of file qdeclarativelistview.cpp.

314  {
315  Q_Q(const QDeclarativeListView);
316  return orient == QDeclarativeListView::Vertical ? q->height() : q->width();
317  }
QDeclarativeListView::Orientation orient
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ snapItemAt()

FxListItem* QDeclarativeListViewPrivate::snapItemAt ( qreal  pos)
inline

Definition at line 435 of file qdeclarativelistview.cpp.

435  {
436  FxListItem *snapItem = 0;
437  for (int i = 0; i < visibleItems.count(); ++i) {
438  FxListItem *item = visibleItems[i];
439  if (item->index == -1)
440  continue;
441  qreal itemTop = item->position();
442  if (highlight && itemTop >= pos && item->endPosition() <= pos + highlight->size() - 1)
443  return item;
444  if (itemTop+item->size()/2 >= pos && itemTop-item->size()/2 < pos)
445  snapItem = item;
446  }
447  return snapItem;
448  }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
qreal endPosition() const
qreal position() const
qreal size() const

◆ snapPosAt()

qreal QDeclarativeListViewPrivate::snapPosAt ( qreal  pos)
inline

Definition at line 421 of file qdeclarativelistview.cpp.

421  {
422  if (FxListItem *snapItem = snapItemAt(pos))
423  return snapItem->position();
424  if (visibleItems.count()) {
425  qreal firstPos = visibleItems.first()->position();
426  qreal endPos = visibleItems.last()->position();
427  if (pos < firstPos) {
428  return firstPos - qRound((firstPos - pos) / averageSize) * averageSize;
429  } else if (pos > endPos)
430  return endPos + qRound((pos - endPos) / averageSize) * averageSize;
431  }
433  }
FxListItem * snapItemAt(qreal pos)
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
qreal position() const
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ startPosition()

qreal QDeclarativeListViewPrivate::startPosition ( ) const
inline

Definition at line 346 of file qdeclarativelistview.cpp.

◆ updateAverage()

void QDeclarativeListViewPrivate::updateAverage ( )

Definition at line 1201 of file qdeclarativelistview.cpp.

1202 {
1203  if (!visibleItems.count())
1204  return;
1205  qreal sum = 0.0;
1206  for (int i = 0; i < visibleItems.count(); ++i)
1207  sum += visibleItems.at(i)->size();
1208  averageSize = qRound(sum / visibleItems.count());
1209 }
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
qreal size() const
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ updateCurrent()

void QDeclarativeListViewPrivate::updateCurrent ( int  modelIndex)

Definition at line 1149 of file qdeclarativelistview.cpp.

1150 {
1152  if (!q->isComponentComplete() || !isValid() || modelIndex < 0 || modelIndex >= model->count()) {
1153  if (currentItem) {
1156  currentItem = 0;
1157  currentIndex = modelIndex;
1158  emit q->currentIndexChanged();
1159  updateHighlight();
1160  } else if (currentIndex != modelIndex) {
1161  currentIndex = modelIndex;
1162  emit q->currentIndexChanged();
1163  }
1164  return;
1165  }
1166 
1167  if (currentItem && currentIndex == modelIndex) {
1168  updateHighlight();
1169  return;
1170  }
1171  FxListItem *oldCurrentItem = currentItem;
1172  currentIndex = modelIndex;
1173  currentItem = createItem(modelIndex);
1174  if (oldCurrentItem && (!currentItem || oldCurrentItem->item != currentItem->item))
1175  oldCurrentItem->attached->setIsCurrentItem(false);
1176  if (currentItem) {
1177  if (modelIndex == visibleIndex - 1 && visibleItems.count()) {
1178  // We can calculate exact postion in this case
1180  } else {
1181  // Create current item now and position as best we can.
1182  // Its position will be corrected when it becomes visible.
1183  currentItem->setPosition(positionAt(modelIndex));
1184  }
1185  currentItem->item->setFocus(true);
1187  // Avoid showing section delegate twice. We still need the section heading so that
1188  // currentItem positioning works correctly.
1189  // This is slightly sub-optimal, but section heading caching minimizes the impact.
1190  if (currentItem->section)
1191  currentItem->section->setVisible(false);
1192  if (visibleItems.isEmpty())
1194  }
1195  updateHighlight();
1196  emit q->currentIndexChanged();
1197  // Release the old current item
1198  releaseItem(oldCurrentItem);
1199 }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void setVisible(bool visible)
If visible is true, the item is made visible.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
qreal positionAt(int modelIndex) const
QDeclarativeItem * item
QDeclarativeListViewAttached * attached
#define emit
Definition: qobjectdefs.h:76
QDeclarativeGuard< QDeclarativeVisualModel > model
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
FxListItem * createItem(int modelIndex)
qreal position() const
void setPosition(qreal pos)
void releaseItem(FxListItem *item)
qreal size() const
QDeclarativeItem * section

◆ updateCurrentSection()

void QDeclarativeListViewPrivate::updateCurrentSection ( )

Definition at line 1124 of file qdeclarativelistview.cpp.

1125 {
1127  if (!sectionCriteria || visibleItems.isEmpty()) {
1128  if (!currentSection.isEmpty()) {
1130  emit q->currentSectionChanged();
1131  }
1132  return;
1133  }
1134  int index = 0;
1135  while (index < visibleItems.count() && visibleItems.at(index)->endPosition() < position())
1136  ++index;
1137 
1138  QString newSection = currentSection;
1139  if (index < visibleItems.count())
1140  newSection = visibleItems.at(index)->attached->section();
1141  else
1142  newSection = visibleItems.first()->attached->section();
1143  if (newSection != currentSection) {
1144  currentSection = newSection;
1145  emit q->currentSectionChanged();
1146  }
1147 }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
QDeclarativeListViewAttached * attached
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
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
QDeclarativeViewSection * sectionCriteria
qreal endPosition() const
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723

◆ updateFooter()

void QDeclarativeListViewPrivate::updateFooter ( )

Definition at line 1211 of file qdeclarativelistview.cpp.

1212 {
1214  if (!footer && footerComponent) {
1216  if (item) {
1217  QDeclarative_setParent_noEvent(item, q->contentItem());
1218  item->setParentItem(q->contentItem());
1219  item->setZValue(1);
1222  footer = new FxListItem(item, q);
1223  }
1224  }
1225  if (footer) {
1226  if (visibleItems.count()) {
1227  qreal endPos = lastPosition() + 1;
1228  if (lastVisibleIndex() == model->count()-1) {
1229  footer->setPosition(endPos);
1230  } else {
1231  qreal visiblePos = position() + q->height();
1232  if (endPos <= visiblePos || footer->position() < endPos)
1233  footer->setPosition(endPos);
1234  }
1235  } else {
1236  footer->setPosition(visiblePos);
1237  }
1238  }
1239 }
QDeclarativeItem * createComponentItem(QDeclarativeComponent *component)
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
QDeclarativeComponent * footerComponent
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_Q(Class)
Definition: qglobal.h:2483
void setParentItem(QDeclarativeItem *parent)
void setZValue(qreal z)
Sets the Z-value of the item to z.
The QDeclarativeItem class provides the most basic of all visual items in QML.
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
QDeclarativeGuard< QDeclarativeVisualModel > model
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
void setPosition(qreal pos)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)

◆ updateHeader()

void QDeclarativeListViewPrivate::updateHeader ( )

Definition at line 1241 of file qdeclarativelistview.cpp.

1242 {
1244  if (!header && headerComponent) {
1246  if (item) {
1247  QDeclarative_setParent_noEvent(item, q->contentItem());
1248  item->setParentItem(q->contentItem());
1249  item->setZValue(1);
1252  header = new FxListItem(item, q);
1253  }
1254  }
1255  if (header) {
1256  if (visibleItems.count()) {
1257  qreal startPos = originPosition();
1258  if (visibleIndex == 0) {
1259  header->setPosition(startPos - header->size());
1260  } else {
1261  if (position() <= startPos || header->position() > startPos - header->size())
1262  header->setPosition(startPos - header->size());
1263  }
1264  } else {
1265  if (itemCount == 0)
1266  visiblePos = header->size();
1267  header->setPosition(0);
1268  }
1269  }
1270 }
QDeclarativeItem * createComponentItem(QDeclarativeComponent *component)
QDeclarativeComponent * headerComponent
double qreal
Definition: qglobal.h:1193
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_Q(Class)
Definition: qglobal.h:2483
void setParentItem(QDeclarativeItem *parent)
void setZValue(qreal z)
Sets the Z-value of the item to z.
The QDeclarativeItem class provides the most basic of all visual items in QML.
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
qreal position() const
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
void setPosition(qreal pos)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
qreal size() const

◆ updateHighlight()

void QDeclarativeListViewPrivate::updateHighlight ( )

Definition at line 1011 of file qdeclarativelistview.cpp.

1012 {
1013  if ((!currentItem && highlight) || (currentItem && !highlight))
1014  createHighlight();
1016  // auto-update highlight
1022  if (highlight->item->width() == 0)
1024  } else {
1025  if (highlight->item->height() == 0)
1027  }
1030  }
1032 }
QDeclarativeListView::Orientation orient
qreal itemPosition() const
QDeclarativeItem * item
qreal itemSize() const
QSmoothedAnimation * highlightSizeAnimator
QSmoothedAnimation * highlightPosAnimator

◆ updateSections()

void QDeclarativeListViewPrivate::updateSections ( )

Definition at line 1093 of file qdeclarativelistview.cpp.

1094 {
1095  if (sectionCriteria && !visibleItems.isEmpty()) {
1096  QString prevSection;
1097  if (visibleIndex > 0)
1098  prevSection = sectionAt(visibleIndex-1);
1099  QDeclarativeListViewAttached *prevAtt = 0;
1100  int idx = -1;
1101  for (int i = 0; i < visibleItems.count(); ++i) {
1103  attached->setPrevSection(prevSection);
1104  if (visibleItems.at(i)->index != -1) {
1106  attached->setSection(sectionCriteria->sectionString(propValue));
1107  idx = visibleItems.at(i)->index;
1108  }
1110  if (prevAtt)
1111  prevAtt->setNextSection(attached->section());
1112  prevSection = attached->section();
1113  prevAtt = attached;
1114  }
1115  if (prevAtt) {
1116  if (idx > 0 && idx < model->count()-1)
1117  prevAtt->setNextSection(sectionAt(idx+1));
1118  else
1119  prevAtt->setNextSection(QString());
1120  }
1121  }
1122 }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
virtual QString stringValue(int, const QString &)=0
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void setNextSection(const QString &sect)
QDeclarativeListViewAttached * attached
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void setPrevSection(const QString &sect)
QDeclarativeGuard< QDeclarativeVisualModel > model
QDeclarativeViewSection * sectionCriteria
QString sectionString(const QString &value)
void setSection(const QString &sect)
QString sectionAt(int modelIndex)

◆ updateTrackedItem()

void QDeclarativeListViewPrivate::updateTrackedItem ( )

Definition at line 939 of file qdeclarativelistview.cpp.

940 {
942  FxListItem *item = currentItem;
943  if (highlight)
944  item = highlight;
945  trackedItem = item;
946  if (trackedItem)
947  q->trackedPositionChanged();
948 }
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ updateUnrequestedIndexes()

void QDeclarativeListViewPrivate::updateUnrequestedIndexes ( )

Definition at line 908 of file qdeclarativelistview.cpp.

909 {
912  for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it)
913  *it = model->indexOf(it.key(), q);
914 }
#define it(className, varName)
virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const =0
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
QDeclarativeGuard< QDeclarativeVisualModel > model
QHash< QDeclarativeItem *, int > unrequestedItems
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464

◆ updateUnrequestedPositions()

void QDeclarativeListViewPrivate::updateUnrequestedPositions ( )

Definition at line 916 of file qdeclarativelistview.cpp.

917 {
919  if (unrequestedItems.count()) {
920  qreal pos = position();
922  for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it) {
923  QDeclarativeItem *item = it.key();
925  if (item->y() + item->height() > pos && item->y() < pos + q->height())
926  item->setY(positionAt(*it));
927  } else {
928  if (item->x() + item->width() > pos && item->x() < pos + q->width()) {
929  if (isRightToLeft())
930  item->setX(-positionAt(*it)-item->width());
931  else
932  item->setX(positionAt(*it));
933  }
934  }
935  }
936  }
937 }
double qreal
Definition: qglobal.h:1193
#define it(className, varName)
QDeclarativeListView::Orientation orient
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
qreal positionAt(int modelIndex) const
The QDeclarativeItem class provides the most basic of all visual items in QML.
void setX(qreal x)
Set&#39;s the x coordinate of the item&#39;s position.
QHash< QDeclarativeItem *, int > unrequestedItems
qreal y() const
This convenience function is equivalent to calling pos().
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
qreal x() const
This convenience function is equivalent to calling pos().
void setY(qreal y)
Set&#39;s the y coordinate of the item&#39;s position.
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

◆ updateViewport()

void QDeclarativeListViewPrivate::updateViewport ( )
inline

Definition at line 476 of file qdeclarativelistview.cpp.

476  {
479  q->setContentHeight(endPosition() - startPosition() + 1);
480  } else {
481  q->setContentWidth(endPosition() - startPosition() + 1);
482  }
483  }
QDeclarativeListView::Orientation orient
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ visibleItem()

FxListItem* QDeclarativeListViewPrivate::visibleItem ( int  modelIndex) const
inline

Definition at line 222 of file qdeclarativelistview.cpp.

222  {
223  if (modelIndex >= visibleIndex && modelIndex < visibleIndex + visibleItems.count()) {
224  for (int i = modelIndex - visibleIndex; i < visibleItems.count(); ++i) {
225  FxListItem *item = visibleItems.at(i);
226  if (item->index == modelIndex)
227  return item;
228  }
229  }
230  return 0;
231  }
QList< FxListItem * > visibleItems
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468

Properties

◆ autoHighlight

bool QDeclarativeListViewPrivate::autoHighlight

Definition at line 590 of file qdeclarativelistview.cpp.

◆ averageSize

qreal QDeclarativeListViewPrivate::averageSize

Definition at line 551 of file qdeclarativelistview.cpp.

◆ buffer

int QDeclarativeListViewPrivate::buffer

Definition at line 564 of file qdeclarativelistview.cpp.

◆ bufferMode

int QDeclarativeListViewPrivate::bufferMode

Definition at line 584 of file qdeclarativelistview.cpp.

◆ correctFlick

bool QDeclarativeListViewPrivate::correctFlick

Definition at line 592 of file qdeclarativelistview.cpp.

◆ currentIndex

int QDeclarativeListViewPrivate::currentIndex

Definition at line 552 of file qdeclarativelistview.cpp.

◆ currentIndexCleared

bool QDeclarativeListViewPrivate::currentIndexCleared

Definition at line 597 of file qdeclarativelistview.cpp.

◆ currentItem

FxListItem* QDeclarativeListViewPrivate::currentItem

Definition at line 546 of file qdeclarativelistview.cpp.

◆ currentSection

QString QDeclarativeListViewPrivate::currentSection

Definition at line 568 of file qdeclarativelistview.cpp.

◆ deferredRelease

bool QDeclarativeListViewPrivate::deferredRelease

Definition at line 595 of file qdeclarativelistview.cpp.

◆ footer

FxListItem* QDeclarativeListViewPrivate::footer

Definition at line 580 of file qdeclarativelistview.cpp.

◆ footerComponent

QDeclarativeComponent* QDeclarativeListViewPrivate::footerComponent

Definition at line 579 of file qdeclarativelistview.cpp.

◆ haveHighlightRange

bool QDeclarativeListViewPrivate::haveHighlightRange

Definition at line 591 of file qdeclarativelistview.cpp.

◆ header

FxListItem* QDeclarativeListViewPrivate::header

Definition at line 582 of file qdeclarativelistview.cpp.

◆ headerComponent

QDeclarativeComponent* QDeclarativeListViewPrivate::headerComponent

Definition at line 581 of file qdeclarativelistview.cpp.

◆ highlight

FxListItem* QDeclarativeListViewPrivate::highlight

Definition at line 560 of file qdeclarativelistview.cpp.

◆ highlightComponent

QDeclarativeComponent* QDeclarativeListViewPrivate::highlightComponent

Definition at line 559 of file qdeclarativelistview.cpp.

◆ highlightMoveDuration

int QDeclarativeListViewPrivate::highlightMoveDuration

Definition at line 573 of file qdeclarativelistview.cpp.

◆ highlightMoveSpeed

qreal QDeclarativeListViewPrivate::highlightMoveSpeed

Definition at line 572 of file qdeclarativelistview.cpp.

◆ highlightPosAnimator

QSmoothedAnimation* QDeclarativeListViewPrivate::highlightPosAnimator

Definition at line 565 of file qdeclarativelistview.cpp.

◆ highlightRange

QDeclarativeListView::HighlightRangeMode QDeclarativeListViewPrivate::highlightRange

Definition at line 576 of file qdeclarativelistview.cpp.

◆ highlightRangeEnd

qreal QDeclarativeListViewPrivate::highlightRangeEnd

Definition at line 556 of file qdeclarativelistview.cpp.

◆ highlightRangeEndValid

bool QDeclarativeListViewPrivate::highlightRangeEndValid

Definition at line 558 of file qdeclarativelistview.cpp.

◆ highlightRangeStart

qreal QDeclarativeListViewPrivate::highlightRangeStart

Definition at line 555 of file qdeclarativelistview.cpp.

◆ highlightRangeStartValid

bool QDeclarativeListViewPrivate::highlightRangeStartValid

Definition at line 557 of file qdeclarativelistview.cpp.

◆ highlightResizeDuration

int QDeclarativeListViewPrivate::highlightResizeDuration

Definition at line 575 of file qdeclarativelistview.cpp.

◆ highlightResizeSpeed

qreal QDeclarativeListViewPrivate::highlightResizeSpeed

Definition at line 574 of file qdeclarativelistview.cpp.

◆ highlightSizeAnimator

QSmoothedAnimation* QDeclarativeListViewPrivate::highlightSizeAnimator

Definition at line 566 of file qdeclarativelistview.cpp.

◆ inFlickCorrection

bool QDeclarativeListViewPrivate::inFlickCorrection

Definition at line 593 of file qdeclarativelistview.cpp.

◆ inViewportMoved

bool QDeclarativeListViewPrivate::inViewportMoved

Definition at line 598 of file qdeclarativelistview.cpp.

◆ itemCount

int QDeclarativeListViewPrivate::itemCount

Definition at line 554 of file qdeclarativelistview.cpp.

◆ layoutDirection

Qt::LayoutDirection QDeclarativeListViewPrivate::layoutDirection

Definition at line 548 of file qdeclarativelistview.cpp.

◆ layoutScheduled

bool QDeclarativeListViewPrivate::layoutScheduled

Definition at line 596 of file qdeclarativelistview.cpp.

◆ lazyRelease

bool QDeclarativeListViewPrivate::lazyRelease

Definition at line 594 of file qdeclarativelistview.cpp.

◆ maxExtent

qreal QDeclarativeListViewPrivate::maxExtent
mutable

Definition at line 586 of file qdeclarativelistview.cpp.

◆ maxExtentDirty

bool QDeclarativeListViewPrivate::maxExtentDirty
mutable

Definition at line 600 of file qdeclarativelistview.cpp.

◆ minExtent

qreal QDeclarativeListViewPrivate::minExtent
mutable

Definition at line 585 of file qdeclarativelistview.cpp.

◆ minExtentDirty

bool QDeclarativeListViewPrivate::minExtentDirty
mutable

Definition at line 599 of file qdeclarativelistview.cpp.

◆ model

QDeclarativeGuard<QDeclarativeVisualModel> QDeclarativeListViewPrivate::model

Definition at line 542 of file qdeclarativelistview.cpp.

◆ modelVariant

QVariant QDeclarativeListViewPrivate::modelVariant

Definition at line 543 of file qdeclarativelistview.cpp.

◆ moveReason

MovementReason QDeclarativeListViewPrivate::moveReason

Definition at line 563 of file qdeclarativelistview.cpp.

◆ orient

QDeclarativeListView::Orientation QDeclarativeListViewPrivate::orient

Definition at line 547 of file qdeclarativelistview.cpp.

◆ overshootDist

qreal QDeclarativeListViewPrivate::overshootDist

Definition at line 578 of file qdeclarativelistview.cpp.

◆ ownModel

bool QDeclarativeListViewPrivate::ownModel

Definition at line 588 of file qdeclarativelistview.cpp.

◆ requestedIndex

int QDeclarativeListViewPrivate::requestedIndex

Definition at line 553 of file qdeclarativelistview.cpp.

◆ sectionCache

QDeclarativeItem* QDeclarativeListViewPrivate::sectionCache[sectionCacheSize]

Definition at line 570 of file qdeclarativelistview.cpp.

◆ sectionCacheSize

const int QDeclarativeListViewPrivate::sectionCacheSize = 4
static

Definition at line 569 of file qdeclarativelistview.cpp.

◆ sectionCriteria

QDeclarativeViewSection* QDeclarativeListViewPrivate::sectionCriteria

Definition at line 567 of file qdeclarativelistview.cpp.

◆ snapMode

QDeclarativeListView::SnapMode QDeclarativeListViewPrivate::snapMode

Definition at line 577 of file qdeclarativelistview.cpp.

◆ spacing

qreal QDeclarativeListViewPrivate::spacing

Definition at line 571 of file qdeclarativelistview.cpp.

◆ trackedItem

FxListItem* QDeclarativeListViewPrivate::trackedItem

Definition at line 561 of file qdeclarativelistview.cpp.

◆ unrequestedItems

QHash<QDeclarativeItem*,int> QDeclarativeListViewPrivate::unrequestedItems

Definition at line 545 of file qdeclarativelistview.cpp.

◆ visibleIndex

int QDeclarativeListViewPrivate::visibleIndex

Definition at line 550 of file qdeclarativelistview.cpp.

◆ visibleItems

QList<FxListItem*> QDeclarativeListViewPrivate::visibleItems

Definition at line 544 of file qdeclarativelistview.cpp.

◆ visiblePos

qreal QDeclarativeListViewPrivate::visiblePos

Definition at line 549 of file qdeclarativelistview.cpp.

◆ wrap

bool QDeclarativeListViewPrivate::wrap

Definition at line 589 of file qdeclarativelistview.cpp.


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