Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuickListView Class Reference

#include <qquicklistview_p.h>

+ Inheritance diagram for QQuickListView:
+ Collaboration diagram for QQuickListView:

Public Types

enum  Orientation { Horizontal = Qt::Horizontal , Vertical = Qt::Vertical }
 
enum  SnapMode { NoSnap , SnapToItem , SnapOneItem }
 
enum  HeaderPositioning { InlineHeader , OverlayHeader , PullBackHeader }
 
enum  FooterPositioning { InlineFooter , OverlayFooter , PullBackFooter }
 
- Public Types inherited from QQuickItemView
enum  LayoutDirection { LeftToRight = Qt::LeftToRight , RightToLeft = Qt::RightToLeft , VerticalTopToBottom , VerticalBottomToTop }
 
enum  VerticalLayoutDirection { TopToBottom = VerticalTopToBottom , BottomToTop = VerticalBottomToTop }
 
enum  HighlightRangeMode { NoHighlightRange , ApplyRange , StrictlyEnforceRange }
 
enum  PositionMode {
  Beginning , Center , End , Visible ,
  Contain , SnapPosition
}
 
- Public Types inherited from QQuickFlickable
enum  BoundsBehaviorFlag { StopAtBounds = 0x0 , DragOverBounds = 0x1 , OvershootBounds = 0x2 , DragAndOvershootBounds = DragOverBounds | OvershootBounds }
 
enum  BoundsMovement { FollowBoundsBehavior = 0x1 }
 
enum  FlickableDirection {
  AutoFlickDirection =0x0 , HorizontalFlick =0x1 , VerticalFlick =0x2 , HorizontalAndVerticalFlick =0x3 ,
  AutoFlickIfNeeded =0xc
}
 
- Public Types inherited from QQuickItem
enum  Flag {
  ItemClipsChildrenToShape = 0x01 , ItemIsFocusScope = 0x04 , ItemHasContents = 0x08 , ItemAcceptsDrops = 0x10 ,
  ItemIsViewport = 0x20 , ItemObservesViewport = 0x40
}
 \qmltype Item \nativetype QQuickItem \inherits QtObject \inqmlmodule QtQuick More...
 
enum  ItemChange {
  ItemChildAddedChange , ItemChildRemovedChange , ItemSceneChange , ItemVisibleHasChanged ,
  ItemParentHasChanged , ItemOpacityHasChanged , ItemActiveFocusHasChanged , ItemRotationHasChanged ,
  ItemAntialiasingHasChanged , ItemDevicePixelRatioHasChanged , ItemEnabledHasChanged , ItemScaleHasChanged ,
  ItemTransformHasChanged
}
 Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes. More...
 
enum  TransformOrigin {
  TopLeft , Top , TopRight , Left ,
  Center , Right , BottomLeft , Bottom ,
  BottomRight
}
 \variable QQuickItem::ItemChangeData::realValue The numeric value that has changed: \l {QQuickItem::opacity()}{opacity}, \l {QQuickItem::rotation()}{rotation}, or \l {QQuickItem::scale()}{scale}, or \l {QScreen::devicePixelRatio}{device pixel ratio}. More...
 

Public Slots

void incrementCurrentIndex ()
 \qmlmethod QtQuick::ListView::incrementCurrentIndex()
 
void decrementCurrentIndex ()
 \qmlmethod QtQuick::ListView::decrementCurrentIndex()
 
- Public Slots inherited from QQuickItem
void update ()
 Schedules a call to updatePaintNode() for this item.
 
- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 

Signals

void spacingChanged ()
 
void orientationChanged ()
 
void currentSectionChanged ()
 
void highlightMoveVelocityChanged ()
 
void highlightResizeVelocityChanged ()
 
void highlightResizeDurationChanged ()
 
void snapModeChanged ()
 
 Q_REVISION (2, 4) void headerPositioningChanged()
 
 Q_REVISION (2, 4) void footerPositioningChanged()
 
- Signals inherited from QQuickItemView
void modelChanged ()
 
void delegateChanged ()
 
void countChanged ()
 
void currentIndexChanged ()
 
void currentItemChanged ()
 
void keyNavigationWrapsChanged ()
 
 Q_REVISION (2, 7) void keyNavigationEnabledChanged()
 
void cacheBufferChanged ()
 
void displayMarginBeginningChanged ()
 
void displayMarginEndChanged ()
 
void layoutDirectionChanged ()
 
void effectiveLayoutDirectionChanged ()
 
void verticalLayoutDirectionChanged ()
 
void headerChanged ()
 
void footerChanged ()
 
void headerItemChanged ()
 
void footerItemChanged ()
 
void highlightChanged ()
 
void highlightItemChanged ()
 
void highlightFollowsCurrentItemChanged ()
 
void highlightRangeModeChanged ()
 
void preferredHighlightBeginChanged ()
 
void preferredHighlightEndChanged ()
 
void highlightMoveDurationChanged ()
 
 Q_REVISION (2, 15) void reuseItemsChanged()
 
- Signals inherited from QQuickFlickable
void contentWidthChanged ()
 
void contentHeightChanged ()
 
void contentXChanged ()
 
void contentYChanged ()
 
void topMarginChanged ()
 
void bottomMarginChanged ()
 
void leftMarginChanged ()
 
void rightMarginChanged ()
 
void originYChanged ()
 
void originXChanged ()
 
void movingChanged ()
 
void movingHorizontallyChanged ()
 
void movingVerticallyChanged ()
 
void flickingChanged ()
 
void flickingHorizontallyChanged ()
 
void flickingVerticallyChanged ()
 
void draggingChanged ()
 
void draggingHorizontallyChanged ()
 
void draggingVerticallyChanged ()
 
void horizontalVelocityChanged ()
 
void verticalVelocityChanged ()
 
void isAtBoundaryChanged ()
 
void flickableDirectionChanged ()
 
void interactiveChanged ()
 
void boundsBehaviorChanged ()
 
 Q_REVISION (2, 10) void boundsMovementChanged()
 
void reboundChanged ()
 
void maximumFlickVelocityChanged ()
 
void flickDecelerationChanged ()
 
void pressDelayChanged ()
 
void movementStarted ()
 
void movementEnded ()
 
void flickStarted ()
 
void flickEnded ()
 
void dragStarted ()
 
void dragEnded ()
 
void pixelAlignedChanged ()
 
 Q_REVISION (2, 12) void synchronousDragChanged()
 
 Q_REVISION (2, 9) void horizontalOvershootChanged()
 
 Q_REVISION (2, 9) void verticalOvershootChanged()
 
void atXEndChanged ()
 
void atYEndChanged ()
 
void atXBeginningChanged ()
 
void atYBeginningChanged ()
 
 Q_REVISION (6, 9) void acceptedButtonsChanged()
 
- Signals inherited from QQuickItem
void childrenRectChanged (const QRectF &)
 
void baselineOffsetChanged (qreal)
 
void stateChanged (const QString &)
 
void focusChanged (bool)
 
void activeFocusChanged (bool)
 
Q_REVISION(6, 7) void focusPolicyChanged(Qt Q_REVISION (2, 1) void activeFocusOnTabChanged(bool)
 
void parentChanged (QQuickItem *)
 
void transformOriginChanged (TransformOrigin)
 
void smoothChanged (bool)
 
void antialiasingChanged (bool)
 
void clipChanged (bool)
 
 Q_REVISION (2, 1) void windowChanged(QQuickWindow *window)
 
void childrenChanged ()
 
void opacityChanged ()
 
void enabledChanged ()
 
void visibleChanged ()
 
void visibleChildrenChanged ()
 
void rotationChanged ()
 
void scaleChanged ()
 
void xChanged ()
 
void yChanged ()
 
void widthChanged ()
 
void heightChanged ()
 
void zChanged ()
 
void implicitWidthChanged ()
 
void implicitHeightChanged ()
 
 Q_REVISION (2, 11) void containmentMaskChanged()
 
 Q_REVISION (6, 0) void paletteChanged()
 
 Q_REVISION (6, 0) void paletteCreated()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 

Public Member Functions

 QQuickListView (QQuickItem *parent=nullptr)
 \qmltype ListView \nativetype QQuickListView \inqmlmodule QtQuick\inherits Flickable
 
 ~QQuickListView ()
 
qreal spacing () const
 \qmlproperty real QtQuick::ListView::spacing
 
void setSpacing (qreal spacing)
 
Orientation orientation () const
 \qmlproperty enumeration QtQuick::ListView::orientation This property holds the orientation of the list.
 
void setOrientation (Orientation)
 
QQuickViewSectionsectionCriteria ()
 \qmlproperty enumeration QtQuick::ListView::layoutDirection This property holds the layout direction of a horizontally-oriented list.
 
QString currentSection () const
 \qmlproperty string QtQuick::ListView::currentSection This property holds the section that is currently at the beginning of the view.
 
void setHighlightFollowsCurrentItem (bool) override
 \qmlattachedproperty bool QtQuick::ListView::isCurrentItem \readonly
 
qreal highlightMoveVelocity () const
 \qmlproperty real QtQuick::ListView::highlightMoveVelocity \qmlproperty int QtQuick::ListView::highlightMoveDuration \qmlproperty real QtQuick::ListView::highlightResizeVelocity \qmlproperty int QtQuick::ListView::highlightResizeDuration
 
void setHighlightMoveVelocity (qreal)
 
qreal highlightResizeVelocity () const
 
void setHighlightResizeVelocity (qreal)
 
int highlightResizeDuration () const
 
void setHighlightResizeDuration (int)
 
void setHighlightMoveDuration (int) override
 
SnapMode snapMode () const
 \qmlproperty enumeration QtQuick::ListView::snapMode
 
void setSnapMode (SnapMode mode)
 
HeaderPositioning headerPositioning () const
 \qmlproperty Component QtQuick::ListView::footer This property holds the component to use as the footer.
 
void setHeaderPositioning (HeaderPositioning positioning)
 
FooterPositioning footerPositioning () const
 \qmlproperty enumeration QtQuick::ListView::footerPositioning
 
void setFooterPositioning (FooterPositioning positioning)
 
- Public Member Functions inherited from QQuickItemView
 QQuickItemView (QQuickFlickablePrivate &dd, QQuickItem *parent=nullptr)
 
 ~QQuickItemView ()
 
QVariant model () const
 
void setModel (const QVariant &)
 
QQmlComponentdelegate () const
 
void setDelegate (QQmlComponent *)
 
int count () const
 
int currentIndex () const
 
void setCurrentIndex (int idx)
 
QQuickItemcurrentItem () const
 
bool isWrapEnabled () const
 
void setWrapEnabled (bool)
 
bool isKeyNavigationEnabled () const
 
void setKeyNavigationEnabled (bool)
 
int cacheBuffer () const
 
void setCacheBuffer (int)
 
int displayMarginBeginning () const
 
void setDisplayMarginBeginning (int)
 
int displayMarginEnd () const
 
void setDisplayMarginEnd (int)
 
Qt::LayoutDirection layoutDirection () const
 
void setLayoutDirection (Qt::LayoutDirection)
 
Qt::LayoutDirection effectiveLayoutDirection () const
 
VerticalLayoutDirection verticalLayoutDirection () const
 
void setVerticalLayoutDirection (VerticalLayoutDirection layoutDirection)
 
QQmlComponentfooter () const
 
void setFooter (QQmlComponent *)
 
QQuickItemfooterItem () const
 
QQmlComponentheader () const
 
void setHeader (QQmlComponent *)
 
QQuickItemheaderItem () const
 
QQmlComponenthighlight () const
 
void setHighlight (QQmlComponent *)
 
QQuickItemhighlightItem () const
 
bool highlightFollowsCurrentItem () const
 
HighlightRangeMode highlightRangeMode () const
 
void setHighlightRangeMode (HighlightRangeMode mode)
 
qreal preferredHighlightBegin () const
 
void setPreferredHighlightBegin (qreal)
 
void resetPreferredHighlightBegin ()
 
qreal preferredHighlightEnd () const
 
void setPreferredHighlightEnd (qreal)
 
void resetPreferredHighlightEnd ()
 
int highlightMoveDuration () const
 
bool reuseItems () const
 
void setReuseItems (bool reuse)
 
Q_INVOKABLE void positionViewAtIndex (int index, int mode)
 
Q_INVOKABLE int indexAt (qreal x, qreal y) const
 
Q_INVOKABLE QQuickItemitemAt (qreal x, qreal y) const
 
 Q_REVISION (2, 13) Q_INVOKABLE QQuickItem *itemAtIndex(int index) const
 
Q_INVOKABLE void positionViewAtBeginning ()
 
Q_INVOKABLE void positionViewAtEnd ()
 
 Q_REVISION (2, 1) Q_INVOKABLE void forceLayout()
 
void setContentX (qreal pos) override
 
void setContentY (qreal pos) override
 
qreal originX () const override
 
qreal originY () const override
 \qmlproperty real QtQuick::Flickable::originX \qmlproperty real QtQuick::Flickable::originY
 
- Public Member Functions inherited from QQuickFlickable
 QQuickFlickable (QQuickItem *parent=nullptr)
 \qmlsignal QtQuick::Flickable::dragStarted()
 
 ~QQuickFlickable () override
 
QQmlListProperty< QObjectflickableData ()
 
QQmlListProperty< QQuickItemflickableChildren ()
 
BoundsBehavior boundsBehavior () const
 \qmlproperty enumeration QtQuick::Flickable::boundsBehavior This property holds whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.
 
void setBoundsBehavior (BoundsBehavior)
 
BoundsMovement boundsMovement () const
 \qmlproperty enumeration QtQuick::Flickable::boundsMovement
 
void setBoundsMovement (BoundsMovement movement)
 
QQuickTransitionrebound () const
 \qmlproperty Transition QtQuick::Flickable::rebound
 
void setRebound (QQuickTransition *transition)
 
qreal contentWidth () const
 \qmlproperty real QtQuick::Flickable::contentWidth \qmlproperty real QtQuick::Flickable::contentHeight
 
void setContentWidth (qreal)
 
qreal contentHeight () const
 
void setContentHeight (qreal)
 
qreal contentX () const
 \qmlproperty real QtQuick::Flickable::contentX \qmlproperty real QtQuick::Flickable::contentY
 
qreal contentY () const
 
qreal topMargin () const
 \qmlproperty real QtQuick::Flickable::topMargin \qmlproperty real QtQuick::Flickable::leftMargin \qmlproperty real QtQuick::Flickable::bottomMargin \qmlproperty real QtQuick::Flickable::rightMargin
 
void setTopMargin (qreal m)
 
qreal bottomMargin () const
 
void setBottomMargin (qreal m)
 
qreal leftMargin () const
 
void setLeftMargin (qreal m)
 
qreal rightMargin () const
 
void setRightMargin (qreal m)
 
bool isMoving () const
 \qmlproperty bool QtQuick::Flickable::moving \qmlproperty bool QtQuick::Flickable::movingHorizontally \qmlproperty bool QtQuick::Flickable::movingVertically
 
bool isMovingHorizontally () const
 
bool isMovingVertically () const
 
bool isFlicking () const
 
bool isFlickingHorizontally () const
 \qmlproperty bool QtQuick::Flickable::flicking \qmlproperty bool QtQuick::Flickable::flickingHorizontally \qmlproperty bool QtQuick::Flickable::flickingVertically
 
bool isFlickingVertically () const
 
bool isDragging () const
 \qmlproperty bool QtQuick::Flickable::dragging \qmlproperty bool QtQuick::Flickable::draggingHorizontally \qmlproperty bool QtQuick::Flickable::draggingVertically
 
bool isDraggingHorizontally () const
 
bool isDraggingVertically () const
 
int pressDelay () const
 \qmlproperty int QtQuick::Flickable::pressDelay
 
void setPressDelay (int delay)
 
qreal maximumFlickVelocity () const
 \qmlproperty real QtQuick::Flickable::maximumFlickVelocity This property holds the maximum velocity that the user can flick the view in pixels/second.
 
void setMaximumFlickVelocity (qreal)
 
qreal flickDeceleration () const
 \qmlproperty real QtQuick::Flickable::flickDeceleration This property holds the rate at which a flick will decelerate: the higher the number, the faster it slows down when the user stops flicking via touch.
 
void setFlickDeceleration (qreal)
 
bool isInteractive () const
 \qmlproperty bool QtQuick::Flickable::interactive
 
void setInteractive (bool)
 
qreal horizontalVelocity () const
 \qmlproperty real QtQuick::Flickable::horizontalVelocity \qmlproperty real QtQuick::Flickable::verticalVelocity
 
qreal verticalVelocity () const
 
bool isAtXEnd () const
 \qmlproperty bool QtQuick::Flickable::atXBeginning \qmlproperty bool QtQuick::Flickable::atXEnd \qmlproperty bool QtQuick::Flickable::atYBeginning \qmlproperty bool QtQuick::Flickable::atYEnd
 
bool isAtXBeginning () const
 
bool isAtYEnd () const
 
bool isAtYBeginning () const
 
QQuickItemcontentItem () const
 \qmlproperty Item QtQuick::Flickable::contentItem
 
FlickableDirection flickableDirection () const
 \qmlproperty enumeration QtQuick::Flickable::flickableDirection
 
void setFlickableDirection (FlickableDirection)
 
bool pixelAligned () const
 \qmlproperty bool QtQuick::Flickable::pixelAligned
 
void setPixelAligned (bool align)
 
bool synchronousDrag () const
 \qmlproperty bool QtQuick::Flickable::synchronousDrag
 
void setSynchronousDrag (bool v)
 
Qt::MouseButtons acceptedButtons () const
 \qmlproperty flags QtQuick::Flickable::acceptedButtons
 
void setAcceptedButtons (Qt::MouseButtons buttons)
 
qreal horizontalOvershoot () const
 \qmlproperty real QtQuick::Flickable::horizontalOvershoot
 
qreal verticalOvershoot () const
 \qmlproperty real QtQuick::Flickable::verticalOvershoot
 
Q_INVOKABLE void resizeContent (qreal w, qreal h, QPointF center)
 \qmlmethod QtQuick::Flickable::resizeContent(real width, real height, QPointF center)
 
Q_INVOKABLE void returnToBounds ()
 \qmlmethod QtQuick::Flickable::returnToBounds()
 
Q_INVOKABLE void flick (qreal xVelocity, qreal yVelocity)
 \qmlmethod QtQuick::Flickable::flick(qreal xVelocity, qreal yVelocity)
 
Q_INVOKABLE void cancelFlick ()
 \qmlmethod QtQuick::Flickable::cancelFlick()
 
- Public Member Functions inherited from QQuickItem
 QQuickItem (QQuickItem *parent=nullptr)
 Constructs a QQuickItem with the given parent.
 
 ~QQuickItem () override
 Destroys the QQuickItem.
 
QQuickWindowwindow () const
 Returns the window in which this item is rendered.
 
QQuickItemparentItem () const
 
void setParentItem (QQuickItem *parent)
 
void stackBefore (const QQuickItem *)
 Moves the specified sibling item to the index before this item within the list of children.
 
void stackAfter (const QQuickItem *)
 Moves the specified sibling item to the index after this item within the list of children.
 
QRectF childrenRect ()
 \qmlpropertygroup QtQuick::Item::childrenRect \qmlproperty real QtQuick::Item::childrenRect.x \qmlproperty real QtQuick::Item::childrenRect.y \qmlproperty real QtQuick::Item::childrenRect.width \qmlproperty real QtQuick::Item::childrenRect.height \readonly
 
QList< QQuickItem * > childItems () const
 Returns the children of this item.
 
bool clip () const
 \qmlproperty bool QtQuick::Item::clip This property holds whether clipping is enabled.
 
void setClip (bool)
 
QString state () const
 \qmlproperty string QtQuick::Item::state
 
void setState (const QString &)
 
qreal baselineOffset () const
 \qmlproperty int QtQuick::Item::baselineOffset
 
void setBaselineOffset (qreal)
 
QQmlListProperty< QQuickTransformtransform ()
 
qreal x () const
 
qreal y () const
 
QPointF position () const
 
void setX (qreal)
 
void setY (qreal)
 
void setPosition (const QPointF &)
 
QBindable< qrealbindableX ()
 
QBindable< qrealbindableY ()
 
qreal width () const
 
void setWidth (qreal)
 
void resetWidth ()
 
void setImplicitWidth (qreal)
 
qreal implicitWidth () const
 Returns the width of the item that is implied by other properties that determine the content.
 
QBindable< qrealbindableWidth ()
 
qreal height () const
 
void setHeight (qreal)
 
void resetHeight ()
 
void setImplicitHeight (qreal)
 
qreal implicitHeight () const
 
QBindable< qrealbindableHeight ()
 
QSizeF size () const
 
void setSize (const QSizeF &size)
 
TransformOrigin transformOrigin () const
 
void setTransformOrigin (TransformOrigin)
 
QPointF transformOriginPoint () const
 
void setTransformOriginPoint (const QPointF &)
 
qreal z () const
 
void setZ (qreal)
 
qreal rotation () const
 
void setRotation (qreal)
 
qreal scale () const
 
void setScale (qreal)
 
qreal opacity () const
 
void setOpacity (qreal)
 
bool isVisible () const
 
void setVisible (bool)
 
bool isEnabled () const
 
void setEnabled (bool)
 
bool smooth () const
 
void setSmooth (bool)
 
bool activeFocusOnTab () const
 \qmlproperty bool QtQuick::Item::activeFocusOnTab
 
void setActiveFocusOnTab (bool)
 
bool antialiasing () const
 
void setAntialiasing (bool)
 
void resetAntialiasing ()
 
Flags flags () const
 Returns the item flags for this item.
 
void setFlag (Flag flag, bool enabled=true)
 Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disabled.
 
void setFlags (Flags flags)
 Enables the specified flags for this item.
 
virtual QRectF boundingRect () const
 Returns the extents of the item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height().
 
virtual QRectF clipRect () const
 Returns the rectangular area within this item that is currently visible in \l viewportItem(), if there is a viewport and the \l ItemObservesViewport flag is set; otherwise, the extents of this item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height().
 
QQuickItemviewportItem () const
 If the \l ItemObservesViewport flag is set, returns the nearest parent with the \l ItemIsViewport flag.
 
bool hasActiveFocus () const
 
bool hasFocus () const
 
void setFocus (bool)
 
void setFocus (bool focus, Qt::FocusReason reason)
 
bool isFocusScope () const
 Returns true if this item is a focus scope, and false otherwise.
 
QQuickItemscopedFocusItem () const
 If this item is a focus scope, this returns the item in its focus chain that currently has focus.
 
Qt::FocusPolicy focusPolicy () const
 
void setFocusPolicy (Qt::FocusPolicy policy)
 Sets the focus policy of this item to policy.
 
bool isAncestorOf (const QQuickItem *child) const
 Returns true if this item is an ancestor of child (i.e., if this item is child's parent, or one of child's parent's ancestors).
 
Qt::MouseButtons acceptedMouseButtons () const
 Returns the mouse buttons accepted by this item.
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 Sets the mouse buttons accepted by this item to buttons.
 
bool acceptHoverEvents () const
 Returns whether hover events are accepted by this item.
 
void setAcceptHoverEvents (bool enabled)
 If enabled is true, this sets the item to accept hover events; otherwise, hover events are not accepted by this item.
 
bool acceptTouchEvents () const
 Returns whether touch events are accepted by this item.
 
void setAcceptTouchEvents (bool accept)
 If enabled is true, this sets the item to accept touch events; otherwise, touch events are not accepted by this item.
 
bool isUnderMouse () const
 
void grabMouse ()
 
void ungrabMouse ()
 
bool keepMouseGrab () const
 Returns whether mouse input should exclusively remain with this item.
 
void setKeepMouseGrab (bool)
 Sets whether the mouse input should remain exclusively with this item.
 
bool filtersChildMouseEvents () const
 Returns whether pointer events intended for this item's children should be filtered through this item.
 
void setFiltersChildMouseEvents (bool filter)
 Sets whether pointer events intended for this item's children should be filtered through this item.
 
void grabTouchPoints (const QList< int > &ids)
 
void ungrabTouchPoints ()
 
bool keepTouchGrab () const
 Returns whether the touch points grabbed by this item should exclusively remain with this item.
 
void setKeepTouchGrab (bool)
 Sets whether the touch points grabbed by this item should remain exclusively with this item.
 
 Q_REVISION (2, 4) Q_INVOKABLE bool grabToImage(const QJSValue &callback
 
QSharedPointer< QQuickItemGrabResultgrabToImage (const QSize &targetSize=QSize())
 Grabs the item into an in-memory image.
 
virtual Q_INVOKABLE bool contains (const QPointF &point) const
 \qmlmethod bool QtQuick::Item::contains(point point)
 
QObjectcontainmentMask () const
 
void setContainmentMask (QObject *mask)
 
QTransform itemTransform (QQuickItem *, bool *) const
 \qmlmethod point QtQuick::Item::mapFromItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::mapFromItem(Item item, point p) \qmlmethod rect QtQuick::Item::mapFromItem(Item item, real x, real y, real width, real height) \qmlmethod rect QtQuick::Item::mapFromItem(Item item, rect r)
 
QPointF mapToScene (const QPointF &point) const
 Maps the given point in this item's coordinate system to the equivalent point within the scene's coordinate system, and returns the mapped coordinate.
 
QRectF mapRectToItem (const QQuickItem *item, const QRectF &rect) const
 Maps the given rect in this item's coordinate system to the equivalent rectangular area within item's coordinate system, and returns the mapped rectangle value.
 
QRectF mapRectToScene (const QRectF &rect) const
 Maps the given rect in this item's coordinate system to the equivalent rectangular area within the scene's coordinate system, and returns the mapped rectangle value.
 
QPointF mapFromScene (const QPointF &point) const
 Maps the given point in the scene's coordinate system to the equivalent point within this item's coordinate system, and returns the mapped coordinate.
 
QRectF mapRectFromItem (const QQuickItem *item, const QRectF &rect) const
 Maps the given rect in item's coordinate system to the equivalent rectangular area within this item's coordinate system, and returns the mapped rectangle value.
 
QRectF mapRectFromScene (const QRectF &rect) const
 Maps the given rect in the scene's coordinate system to the equivalent rectangular area within this item's coordinate system, and returns the mapped rectangle value.
 
void polish ()
 Schedules a polish event for this item.
 
Q_INVOKABLE QPointF mapFromItem (const QQuickItem *item, const QPointF &point) const
 Maps the given point in item's coordinate system to the equivalent point within this item's coordinate system, and returns the mapped coordinate.
 
Q_INVOKABLE QPointF mapFromItem (const QQuickItem *item, qreal x, qreal y)
 
Q_INVOKABLE QRectF mapFromItem (const QQuickItem *item, const QRectF &rect) const
 
Q_INVOKABLE QRectF mapFromItem (const QQuickItem *item, qreal x, qreal y, qreal width, qreal height) const
 
Q_INVOKABLE QPointF mapToItem (const QQuickItem *item, const QPointF &point) const
 Maps the given point in this item's coordinate system to the equivalent point within item's coordinate system, and returns the mapped coordinate.
 
Q_INVOKABLE QPointF mapToItem (const QQuickItem *item, qreal x, qreal y)
 
Q_INVOKABLE QRectF mapToItem (const QQuickItem *item, const QRectF &rect) const
 
Q_INVOKABLE QRectF mapToItem (const QQuickItem *item, qreal x, qreal y, qreal width, qreal height) const
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapFromGlobal(qreal x
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapFromGlobal(const QPointF &point) const
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapToGlobal(qreal x
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapToGlobal(const QPointF &point) const
 
Q_INVOKABLE void forceActiveFocus ()
 \qmlmethod point QtQuick::Item::mapToItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::mapToItem(Item item, point p) \qmlmethod rect QtQuick::Item::mapToItem(Item item, real x, real y, real width, real height) \qmlmethod rect QtQuick::Item::mapToItem(Item item, rect r)
 
Q_INVOKABLE void forceActiveFocus (Qt::FocusReason reason)
 \qmlmethod QtQuick::Item::forceActiveFocus(Qt::FocusReason reason) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Forces active focus on the item with the given reason.
 
 Q_REVISION (2, 1) Q_INVOKABLE QQuickItem *nextItemInFocusChain(bool forward
 
Q_INVOKABLE QQuickItemchildAt (qreal x, qreal y) const
 \qmlmethod QtQuick::Item::childAt(real x, real y)
 
 Q_REVISION (6, 3) Q_INVOKABLE void ensurePolished()
 
 Q_REVISION (6, 3) Q_INVOKABLE void dumpItemTree() const
 
virtual bool isTextureProvider () const
 Returns true if this item is a texture provider.
 
virtual QSGTextureProvidertextureProvider () const
 Returns the texture provider for an item.
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 
- Public Member Functions inherited from QQmlParserStatus
 QQmlParserStatus ()
 
virtual ~QQmlParserStatus ()
 

Static Public Member Functions

static QQuickListViewAttachedqmlAttachedProperties (QObject *)
 \qmlmethod QtQuick::ListView::positionViewAtIndex(int index, PositionMode mode)
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 

Protected Member Functions

void viewportMoved (Qt::Orientations orient) override
 \qmlproperty Transition QtQuick::ListView::populate
 
void keyPressEvent (QKeyEvent *) override
 This event handler can be reimplemented in a subclass to receive key press events for an item.
 
void geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry) override
 
void initItem (int index, QObject *item) override
 
qreal maxYExtent () const override
 
qreal maxXExtent () const override
 
- Protected Member Functions inherited from QQuickItemView
void updatePolish () override
 This function should perform any layout as required for this item.
 
void componentComplete () override
 Invoked after the root component that caused this instantiation has completed construction.
 
qreal minYExtent () const override
 
qreal minXExtent () const override
 
 Q_REVISION (2, 15) void onItemReused(int modelIndex
 
void animStopped ()
 
void trackedPositionChanged ()
 
- Protected Member Functions inherited from QQuickFlickable
bool childMouseEventFilter (QQuickItem *, QEvent *) override
 
void mousePressEvent (QMouseEvent *event) override
 This event handler can be reimplemented in a subclass to receive mouse press events for an item.
 
void mouseMoveEvent (QMouseEvent *event) override
 This event handler can be reimplemented in a subclass to receive mouse move events for an item.
 
void mouseReleaseEvent (QMouseEvent *event) override
 This event handler can be reimplemented in a subclass to receive mouse release events for an item.
 
void touchEvent (QTouchEvent *event) override
 This event handler can be reimplemented in a subclass to receive touch events for an item.
 
void timerEvent (QTimerEvent *event) override
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
QQuickFlickableVisibleAreavisibleArea ()
 
qreal vWidth () const
 
qreal vHeight () const
 
void mouseUngrabEvent () override
 This event handler can be reimplemented in a subclass to be notified when a mouse ungrab event has occurred on this item.
 
bool filterPointerEvent (QQuickItem *receiver, QPointerEvent *event)
 
bool xflick () const
 
bool yflick () const
 
 QQuickFlickable (QQuickFlickablePrivate &dd, QQuickItem *parent)
 
- Protected Member Functions inherited from QQuickItem
bool event (QEvent *) override
 \reimp
 
bool isComponentComplete () const
 Returns true if construction of the QML component is complete; otherwise returns false.
 
virtual void itemChange (ItemChange, const ItemChangeData &)
 Called when change occurs for this item.
 
bool widthValid () const
 Returns whether the width property has been set explicitly.
 
bool heightValid () const
 Returns whether the height property has been set explicitly.
 
void setImplicitSize (qreal, qreal)
 
void classBegin () override
 \reimp Derived classes should call the base class method before adding their own action to perform at classBegin.
 
virtual void keyReleaseEvent (QKeyEvent *event)
 This event handler can be reimplemented in a subclass to receive key release events for an item.
 
virtual void focusInEvent (QFocusEvent *)
 This event handler can be reimplemented in a subclass to receive focus-in events for an item.
 
virtual void focusOutEvent (QFocusEvent *)
 This event handler can be reimplemented in a subclass to receive focus-out events for an item.
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 This event handler can be reimplemented in a subclass to receive mouse double-click events for an item.
 
virtual void touchUngrabEvent ()
 This event handler can be reimplemented in a subclass to be notified when a touch ungrab event has occurred on this item.
 
virtual void hoverEnterEvent (QHoverEvent *event)
 This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
 
virtual void hoverMoveEvent (QHoverEvent *event)
 This event handler can be reimplemented in a subclass to receive hover-move events for an item.
 
virtual void hoverLeaveEvent (QHoverEvent *event)
 This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
 
virtual QSGNodeupdatePaintNode (QSGNode *, UpdatePaintNodeData *)
 Called on the render thread when it is time to sync the state of the item with the scene graph.
 
virtual void releaseResources ()
 This function is called when an item should release graphics resources which are not already managed by the nodes returned from QQuickItem::updatePaintNode().
 
 QQuickItem (QQuickItemPrivate &dd, QQuickItem *parent=nullptr)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Properties

qreal highlightMoveVelocity
 
qreal highlightResizeVelocity
 
int highlightResizeDuration
 
qreal spacing
 
Orientation orientation
 
QQuickViewSectionsection
 
QString currentSection
 
SnapMode snapMode
 
HeaderPositioning headerPositioning
 
FooterPositioning footerPositioning
 
- Properties inherited from QQuickItemView
QVariant model
 
QQmlComponentdelegate
 
int count
 
int currentIndex
 
QQuickItemcurrentItem
 
bool keyNavigationWraps
 
bool keyNavigationEnabled
 
int cacheBuffer
 
int displayMarginBeginning
 
int displayMarginEnd
 
Qt::LayoutDirection layoutDirection
 
Qt::LayoutDirection effectiveLayoutDirection
 
VerticalLayoutDirection verticalLayoutDirection
 
QQmlComponentheader
 
QQuickItemheaderItem
 
QQmlComponentfooter
 
QQuickItemfooterItem
 
QQmlComponenthighlight
 
QQuickItemhighlightItem
 
bool highlightFollowsCurrentItem
 
HighlightRangeMode highlightRangeMode
 
qreal preferredHighlightBegin
 
qreal preferredHighlightEnd
 
int highlightMoveDuration
 
bool reuseItems
 
- Properties inherited from QQuickFlickable
qreal contentWidth
 
qreal contentHeight
 
qreal contentX
 
qreal contentY
 
QQuickItemcontentItem
 
qreal topMargin
 
qreal bottomMargin
 
qreal originY
 
qreal leftMargin
 
qreal rightMargin
 
qreal originX
 
qreal horizontalVelocity
 
qreal verticalVelocity
 
BoundsBehavior boundsBehavior
 
BoundsMovement boundsMovement
 
QQuickTransitionrebound
 
qreal maximumFlickVelocity
 
qreal flickDeceleration
 
bool moving
 
bool movingHorizontally
 
bool movingVertically
 
bool flicking
 
bool flickingHorizontally
 
bool flickingVertically
 
bool dragging
 
bool draggingHorizontally
 
bool draggingVertically
 
FlickableDirection flickableDirection
 
bool interactive
 
int pressDelay
 
bool atXEnd
 
bool atYEnd
 
bool atXBeginning
 
bool atYBeginning
 
QQuickFlickableVisibleAreavisibleArea
 
bool pixelAligned
 
bool synchronousDrag
 
qreal horizontalOvershoot
 
qreal verticalOvershoot
 
Qt::MouseButtons acceptedButtons
 
FINALQQmlListProperty< QObjectflickableData
 
QQmlListProperty< QQuickItemflickableChildren
 
- Properties inherited from QQuickItem
QQuickItemparent
 \qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
 
qreal x
 \qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item::width \qmlproperty real QtQuick::Item::height
 
qreal y
 Defines the item's y position relative to its parent.
 
qreal z
 \qmlproperty real QtQuick::Item::z
 
qreal width
 This property holds the width of this item.
 
qreal height
 This property holds the height of this item.
 
qreal opacity
 \qmlproperty real QtQuick::Item::opacity
 
bool enabled
 \qmlproperty bool QtQuick::Item::enabled
 
bool visible
 \qmlproperty bool QtQuick::Item::visible
 
Qt::FocusPolicy focusPolicy
 \qmlproperty enumeration QtQuick::Item::focusPolicy
 
qreal rotation
 \qmlproperty real QtQuick::Item::rotation This property holds the rotation of the item in degrees clockwise around its transformOrigin.
 
qreal scale
 \qmlproperty real QtQuick::Item::scale This property holds the scale factor for this item.
 
TransformOrigin transformOrigin
 \qmlproperty enumeration QtQuick::Item::transformOrigin This property holds the origin point around which scale and rotation transform.
 
QPointF transformOriginPoint
 
QQmlListProperty< QQuickTransformtransform
 \qmlproperty list<Transform> QtQuick::Item::transform This property holds the list of transformations to apply.
 
bool smooth
 \qmlproperty bool QtQuick::Item::smooth
 
bool antialiasing
 \qmlproperty bool QtQuick::Item::antialiasing
 
qreal implicitWidth
 
qreal implicitHeight
 
QObjectcontainmentMask
 \qmlproperty QObject* QtQuick::Item::containmentMask
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Additional Inherited Members

- Public Attributes inherited from QQuickItem
const QSizetargetSize = QSize())
 
qreal y const
 
- Protected Slots inherited from QQuickItemView
void destroyRemoved ()
 
void createdItem (int index, QObject *item)
 
void modelUpdated (const QQmlChangeSet &changeSet, bool reset)
 
void destroyingItem (QObject *item)
 
 Q_REVISION (2, 15) void onItemPooled(int modelIndex
 
- Protected Slots inherited from QQuickFlickable
void movementStarting ()
 
void movementEnding ()
 
void movementEnding (bool hMovementEnding, bool vMovementEnding)
 
void velocityTimelineCompleted ()
 
void timelineCompleted ()
 
- Protected Attributes inherited from QQuickItemView
QObjectobject
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

Definition at line 80 of file qquicklistview_p.h.

Member Enumeration Documentation

◆ FooterPositioning

Enumerator
InlineFooter 
OverlayFooter 
PullBackFooter 

Definition at line 143 of file qquicklistview_p.h.

◆ HeaderPositioning

Enumerator
InlineHeader 
OverlayHeader 
PullBackHeader 

Definition at line 138 of file qquicklistview_p.h.

◆ Orientation

Enumerator
Horizontal 
Vertical 

Definition at line 112 of file qquicklistview_p.h.

◆ SnapMode

Enumerator
NoSnap 
SnapToItem 
SnapOneItem 

Definition at line 133 of file qquicklistview_p.h.

Constructor & Destructor Documentation

◆ QQuickListView()

QQuickListView::QQuickListView ( QQuickItem * parent = nullptr)

\qmltype ListView \nativetype QQuickListView \inqmlmodule QtQuick\inherits Flickable

Provides a list view of items provided by a model.

A ListView displays data from models created from built-in QML types like ListModel and XmlListModel, or custom model classes defined in C++ that inherit from QAbstractItemModel or QAbstractListModel.

A ListView has a \l model, which defines the data to be displayed, and a \l delegate, which defines how the data should be displayed. Items in a ListView are laid out horizontally or vertically. List views are inherently flickable because ListView inherits from \l Flickable.

Note
ListView will only load as many delegate items as needed to fill up the view. Items outside of the view will not be loaded unless a sufficient \l cacheBuffer has been set. Hence, a ListView with zero width or height might not load any delegate items at all.

Definition at line 2261 of file qquicklistview.cpp.

◆ ~QQuickListView()

QQuickListView::~QQuickListView ( )

Definition at line 2266 of file qquicklistview.cpp.

Member Function Documentation

◆ currentSection()

QString QQuickListView::currentSection ( ) const

\qmlproperty string QtQuick::ListView::currentSection This property holds the section that is currently at the beginning of the view.

Definition at line 2832 of file qquicklistview.cpp.

◆ currentSectionChanged

void QQuickListView::currentSectionChanged ( )
signal

◆ decrementCurrentIndex

void QQuickListView::decrementCurrentIndex ( )
slot

\qmlmethod QtQuick::ListView::decrementCurrentIndex()

Decrements the current index. The current index will wrap if keyNavigationWraps is true and it is currently at the beginning. This method has no effect if the \l count is zero.

Note: methods should only be called after the Component has completed.

Definition at line 3647 of file qquicklistview.cpp.

◆ footerPositioning()

QQuickListView::FooterPositioning QQuickListView::footerPositioning ( ) const

\qmlproperty enumeration QtQuick::ListView::footerPositioning

Since
Qt 5.4

This property determines the positioning of the \l{footerItem}{footer item}.

\value ListView.InlineFooter (default) The footer is positioned at the end of the content and moves together with the content like an ordinary item.

\value ListView.OverlayFooter The footer is positioned at the end of the view.

\value ListView.PullBackFooter The footer is positioned at the end of the view. The footer can be pushed away by moving the content backwards, and pulled back by moving the content forwards.

Note
This property has no effect on the \l {QQuickItem::z}{stacking order} of the footer. For example, if the footer should be shown above the \l delegate items when using ListView.OverlayFooter, its Z value should be set to a value higher than that of the delegates. For more information, see \l {Stacking Order in ListView}.
If footerPositioning is not set to ListView.InlineFooter, the user cannot press and flick the list from the footer. In any case, the \l{footerItem}{footer item} may contain items or event handlers that provide custom handling of mouse or touch input.

Definition at line 3095 of file qquicklistview.cpp.

◆ geometryChange()

void QQuickListView::geometryChange ( const QRectF & newGeometry,
const QRectF & oldGeometry )
overrideprotectedvirtual
Since
6.0

This function is called to handle this item's changes in geometry from oldGeometry to newGeometry. If the two geometries are the same, it doesn't do anything.

Derived classes must call the base class method within their implementation.

Reimplemented from QQuickItemView.

Definition at line 3565 of file qquicklistview.cpp.

◆ headerPositioning()

QQuickListView::HeaderPositioning QQuickListView::headerPositioning ( ) const

\qmlproperty Component QtQuick::ListView::footer This property holds the component to use as the footer.

An instance of the footer component is created for each view. The footer is positioned at the end of the view, after any items. The default \l {QQuickItem::z}{stacking order} of the footer is 1.

See also
header, footerItem, {Stacking Order in ListView}

\qmlproperty Component QtQuick::ListView::header This property holds the component to use as the header.

An instance of the header component is created for each view. The header is positioned at the beginning of the view, before any items. The default \l {QQuickItem::z}{stacking order} of the header is 1.

See also
footer, headerItem, {Stacking Order in ListView}

\qmlproperty Item QtQuick::ListView::headerItem This holds the header item created from the \l header component.

An instance of the header component is created for each view. The header is positioned at the beginning of the view, before any items. The default \l {QQuickItem::z}{stacking order} of the header is 1.

See also
header, footerItem, {Stacking Order in ListView}

\qmlproperty Item QtQuick::ListView::footerItem This holds the footer item created from the \l footer component.

An instance of the footer component is created for each view. The footer is positioned at the end of the view, after any items. The default \l {QQuickItem::z}{stacking order} of the footer is 1.

See also
footer, headerItem, {Stacking Order in ListView}

\qmlproperty enumeration QtQuick::ListView::headerPositioning

Since
Qt 5.4

This property determines the positioning of the \l{headerItem}{header item}.

\value ListView.InlineHeader (default) The header is positioned at the beginning of the content and moves together with the content like an ordinary item.

\value ListView.OverlayHeader The header is positioned at the beginning of the view.

\value ListView.PullBackHeader The header is positioned at the beginning of the view. The header can be pushed away by moving the content forwards, and pulled back by moving the content backwards.

Note
This property has no effect on the \l {QQuickItem::z}{stacking order} of the header. For example, if the header should be shown above the \l delegate items when using ListView.OverlayHeader, its Z value should be set to a value higher than that of the delegates. For more information, see \l {Stacking Order in ListView}.
If headerPositioning is not set to ListView.InlineHeader, the user cannot press and flick the list from the header. In any case, the \l{headerItem}{header item} may contain items or event handlers that provide custom handling of mouse or touch input.

Definition at line 3048 of file qquicklistview.cpp.

◆ highlightMoveVelocity()

qreal QQuickListView::highlightMoveVelocity ( ) const

\qmlproperty real QtQuick::ListView::highlightMoveVelocity \qmlproperty int QtQuick::ListView::highlightMoveDuration \qmlproperty real QtQuick::ListView::highlightResizeVelocity \qmlproperty int QtQuick::ListView::highlightResizeDuration

These properties control the speed of the move and resize animations for the highlight delegate.

\l highlightFollowsCurrentItem must be true for these properties to have effect.

The default value for the velocity properties is 400 pixels/second. The default value for the duration properties is -1, i.e. the highlight will take as much time as necessary to move at the set speed.

These properties have the same characteristics as a SmoothedAnimation: if both the velocity and duration are set, the animation will use whichever gives the shorter duration.

The move velocity and duration properties are used to control movement due to index changes; for example, when incrementCurrentIndex() is called. When the user flicks a ListView, the velocity from the flick is used to control the movement instead.

To set only one property, the other can be set to -1. For example, if you only want to animate the duration and not velocity, use the following code:

See also
highlightFollowsCurrentItem

Definition at line 2874 of file qquicklistview.cpp.

◆ highlightMoveVelocityChanged

void QQuickListView::highlightMoveVelocityChanged ( )
signal

◆ highlightResizeDuration()

int QQuickListView::highlightResizeDuration ( ) const

Definition at line 2920 of file qquicklistview.cpp.

◆ highlightResizeDurationChanged

void QQuickListView::highlightResizeDurationChanged ( )
signal

◆ highlightResizeVelocity()

qreal QQuickListView::highlightResizeVelocity ( ) const

Definition at line 2901 of file qquicklistview.cpp.

◆ highlightResizeVelocityChanged

void QQuickListView::highlightResizeVelocityChanged ( )
signal

◆ incrementCurrentIndex

void QQuickListView::incrementCurrentIndex ( )
slot

\qmlmethod QtQuick::ListView::incrementCurrentIndex()

Increments the current index. The current index will wrap if keyNavigationWraps is true and it is currently at the end. This method has no effect if the \l count is zero.

Note: methods should only be called after the Component has completed.

Definition at line 3627 of file qquicklistview.cpp.

◆ initItem()

void QQuickListView::initItem ( int index,
QObject * item )
overrideprotectedvirtual

Reimplemented from QQuickItemView.

Definition at line 3587 of file qquicklistview.cpp.

◆ keyPressEvent()

void QQuickListView::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive key press events for an item.

The event information is provided by the event parameter.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 3530 of file qquicklistview.cpp.

◆ maxXExtent()

qreal QQuickListView::maxXExtent ( ) const
overrideprotectedvirtual

Reimplemented from QQuickItemView.

Definition at line 3610 of file qquicklistview.cpp.

◆ maxYExtent()

qreal QQuickListView::maxYExtent ( ) const
overrideprotectedvirtual

Reimplemented from QQuickItemView.

Definition at line 3602 of file qquicklistview.cpp.

◆ orientation()

QQuickListView::Orientation QQuickListView::orientation ( ) const

\qmlproperty enumeration QtQuick::ListView::orientation This property holds the orientation of the list.

Possible values:

\value ListView.Horizontal Items are laid out horizontally \br \inlineimage ListViewHorizontal.png \value ListView.Vertical (default) Items are laid out vertically \br \inlineimage listview-highlight.png

See also
{Flickable Direction}

Definition at line 2593 of file qquicklistview.cpp.

◆ orientationChanged

void QQuickListView::orientationChanged ( )
signal

◆ Q_REVISION [1/2]

QQuickListView::Q_REVISION ( 2 ,
4  )
signal

◆ Q_REVISION [2/2]

QQuickListView::Q_REVISION ( 2 ,
4  )
signal

◆ qmlAttachedProperties()

QQuickListViewAttached * QQuickListView::qmlAttachedProperties ( QObject * obj)
static

\qmlmethod QtQuick::ListView::positionViewAtIndex(int index, PositionMode mode)

Positions the view such that the index is at the position specified by mode:

\value ListView.Beginning position item at the top (or left for horizontal orientation) of the view. \value ListView.Center position item in the center of the view. \value ListView.End position item at bottom (or right for horizontal orientation) of the view. \value ListView.Visible if any part of the item is visible then take no action, otherwise bring the item into view. \value ListView.Contain ensure the entire item is visible. If the item is larger than the view, the item is positioned at the top (or left for horizontal orientation) of the view. \value ListView.SnapPosition position the item at \l preferredHighlightBegin. This mode is only valid if \l highlightRangeMode is StrictlyEnforceRange or snapping is enabled via \l snapMode.

If positioning the view at index would cause empty space to be displayed at the beginning or end of the view, the view will be positioned at the boundary.

It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view at a particular index. This is unreliable since removing items from the start of the list does not cause all other items to be repositioned, and because the actual start of the view can vary based on the size of the delegates. The correct way to bring an item into view is with positionViewAtIndex.

Note: methods should only be called after the Component has completed. To position the view at startup, this method should be called by Component.onCompleted. For example, to position the view at the end:

Component.onCompleted: positionViewAtIndex(count - 1, ListView.Beginning)
Q_INVOKABLE void positionViewAtIndex(int index, int mode)
GLenum GLenum GLsizei count

\qmlmethod QtQuick::ListView::positionViewAtBeginning() \qmlmethod QtQuick::ListView::positionViewAtEnd()

Positions the view at the beginning or end, taking into account any header or footer.

It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view at a particular index. This is unreliable since removing items from the start of the list does not cause all other items to be repositioned, and because the actual start of the view can vary based on the size of the delegates.

Note: methods should only be called after the Component has completed. To position the view at startup, this method should be called by Component.onCompleted. For example, to position the view at the end on startup:

Component.onCompleted: positionViewAtEnd()
Q_INVOKABLE void positionViewAtEnd()

\qmlmethod int QtQuick::ListView::indexAt(real x, real y)

Returns the index of the visible item containing the point x, y in content coordinates. If there is no item at the point specified, or the item is not visible -1 is returned.

If the item is outside the visible area, -1 is returned, regardless of whether an item will exist at that point when scrolled into view.

Note: methods should only be called after the Component has completed.

\qmlmethod Item QtQuick::ListView::itemAt(real x, real y)

Returns the visible item containing the point x, y in content coordinates. If there is no item at the point specified, or the item is not visible null is returned.

If the item is outside the visible area, null is returned, regardless of whether an item will exist at that point when scrolled into view.

Note: methods should only be called after the Component has completed.

\qmlmethod Item QtQuick::ListView::itemAtIndex(int index)

Returns the item for index. If there is no item for that index, for example because it has not been created yet, or because it has been panned out of the visible area and removed from the cache, null is returned.

Note: this method should only be called after the Component has completed. The returned value should also not be stored since it can turn to null as soon as control goes out of the calling scope, if the view releases that item.

Since
5.13

\qmlmethod QtQuick::ListView::forceLayout()

Responding to changes in the model is usually batched to happen only once per frame. This means that inside script blocks it is possible for the underlying model to have changed, but the ListView has not caught up yet.

This method forces the ListView to immediately respond to any outstanding changes in the model.

Since
5.1

Note: methods should only be called after the Component has completed.

Definition at line 4008 of file qquicklistview.cpp.

◆ sectionCriteria()

QQuickViewSection * QQuickListView::sectionCriteria ( )

\qmlproperty enumeration QtQuick::ListView::layoutDirection This property holds the layout direction of a horizontally-oriented list.

Possible values:

\value Qt.LeftToRight (default) Items will be laid out from left to right. \value Qt.RightToLeft Items will be laid out from right to left.

Setting this property has no effect if the \l orientation is Qt.Vertical.

See also
ListView::effectiveLayoutDirection, ListView::verticalLayoutDirection

\qmlproperty enumeration QtQuick::ListView::effectiveLayoutDirection This property holds the effective layout direction of a horizontally-oriented list.

When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, the visual layout direction of the horizontal list will be mirrored. However, the property \l {ListView::layoutDirection}{layoutDirection} will remain unchanged.

See also
ListView::layoutDirection, {LayoutMirroring}{LayoutMirroring}

\qmlproperty enumeration QtQuick::ListView::verticalLayoutDirection This property holds the layout direction of a vertically-oriented list.

Possible values:

\value ListView.TopToBottom (default) Items are laid out from the top of the view down to the bottom of the view. \value ListView.BottomToTop Items are laid out from the bottom of the view up to the top of the view.

Setting this property has no effect if the \l orientation is Qt.Horizontal.

See also
ListView::layoutDirection

\qmlproperty bool QtQuick::ListView::keyNavigationWraps This property holds whether the list wraps key navigation.

If this is true, key navigation that would move the current item selection past the end of the list instead wraps around and moves the selection to the start of the list, and vice-versa.

By default, key navigation is not wrapped.

\qmlproperty bool QtQuick::ListView::keyNavigationEnabled

Since
5.7

This property holds whether the key navigation of the list is enabled.

If this is true, the user can navigate the view with a keyboard. It is useful for applications that need to selectively enable or disable mouse and keyboard interaction.

By default, the value of this property is bound to \l {Flickable::}{interactive} to ensure behavior compatibility for existing applications. When explicitly set, it will cease to be bound to the interactive property.

See also
{Flickable::}{interactive}

\qmlproperty int QtQuick::ListView::cacheBuffer This property determines whether delegates are retained outside the visible area of the view.

If this value is greater than zero, the view may keep as many delegates instantiated as it can fit within the buffer specified. For example, if in a vertical view the delegate is 20 pixels high and cacheBuffer is set to 40, then up to 2 delegates above and 2 delegates below the visible area may be created/retained. The buffered delegates are created asynchronously, allowing creation to occur across multiple frames and reducing the likelihood of skipping frames. In order to improve painting performance delegates outside the visible area are not painted.

The default value of this property is platform dependent, but will usually be a value greater than zero. Negative values are ignored.

Note that cacheBuffer is not a pixel buffer - it only maintains additional instantiated delegates.

Note
Setting this property is not a replacement for creating efficient delegates. It can improve the smoothness of scrolling behavior at the expense of additional memory usage. The fewer objects and bindings in a delegate, the faster a view can be scrolled. It is important to realize that setting a cacheBuffer will only postpone issues caused by slow-loading delegates, it is not a solution for this scenario.

The cacheBuffer operates outside of any display margins specified by displayMarginBeginning or displayMarginEnd.

\qmlproperty int QtQuick::ListView::displayMarginBeginning \qmlproperty int QtQuick::ListView::displayMarginEnd

Since
QtQuick 2.3

This property allows delegates to be displayed outside of the view geometry.

If this value is non-zero, the view will create extra delegates before the start of the view, or after the end. The view will create as many delegates as it can fit into the pixel size specified.

For example, if in a vertical view the delegate is 20 pixels high and displayMarginBeginning and displayMarginEnd are both set to 40, then 2 delegates above and 2 delegates below will be created and shown.

The default value is 0.

This property is meant for allowing certain UI configurations, and not as a performance optimization. If you wish to create delegates outside of the view geometry for performance reasons, you probably want to use the cacheBuffer property instead.

\qmlpropertygroup QtQuick::ListView::section \qmlproperty string QtQuick::ListView::section.property \qmlproperty enumeration QtQuick::ListView::section.criteria \qmlproperty Component QtQuick::ListView::section.delegate \qmlproperty enumeration QtQuick::ListView::section.labelPositioning

These properties determine the expression to be evaluated and appearance of the section labels.

section.property holds the name of the property that is the basis of each section.

section.criteria holds the criteria for forming each section based on section.property. This value can be one of:

\value ViewSection.FullString (default) sections are created based on the section.property value. \value ViewSection.FirstCharacter sections are created based on the first character of the section.property value (for example, 'A', 'B', 'C' ... sections for an address book.)

A case insensitive comparison is used when determining section boundaries.

section.delegate holds the delegate component for each section. The default \l {QQuickItem::z}{stacking order} of section delegate instances is 2. If you declare a required property named "section" in it, that property will contain the section's title.

section.labelPositioning determines whether the current and/or next section labels stick to the start/end of the view, and whether the labels are shown inline. This value can be a combination of:

\value ViewSection.InlineLabels (default) section labels are shown inline between the item delegates separating sections. \value ViewSection.CurrentLabelAtStart the current section label sticks to the start of the view as it is moved. \value ViewSection.NextLabelAtEnd the next section label (beyond all visible sections) sticks to the end of the view as it is moved.

Note
Enabling ViewSection.NextLabelAtEnd requires the view to scan ahead for the next section, which has performance implications, especially for slower models.

Each item in the list has attached properties named ListView.section, ListView.previousSection and ListView.nextSection.

For example, here is a ListView that displays a list of animals, separated into sections. Each item in the ListView is placed in a different section depending on the "size" property of the model item. The sectionHeading delegate component provides the light blue bar that marks the beginning of each section.

Note
Adding sections to a ListView does not automatically re-order the list items by the section criteria. If the model is not ordered by section, then it is possible that the sections created will not be unique; each boundary between differing sections will result in a section header being created even if that section exists elsewhere.
See also
{Qt Quick Examples - Views}{ListView examples}, {Stacking Order in ListView}

Definition at line 2820 of file qquicklistview.cpp.

◆ setFooterPositioning()

void QQuickListView::setFooterPositioning ( QQuickListView::FooterPositioning positioning)

Definition at line 3101 of file qquicklistview.cpp.

◆ setHeaderPositioning()

void QQuickListView::setHeaderPositioning ( QQuickListView::HeaderPositioning positioning)

Definition at line 3054 of file qquicklistview.cpp.

◆ setHighlightFollowsCurrentItem()

void QQuickListView::setHighlightFollowsCurrentItem ( bool autoHighlight)
overridevirtual

\qmlattachedproperty bool QtQuick::ListView::isCurrentItem \readonly

This attached property is true if this delegate is the current item; otherwise false.

It is attached to each instance of the delegate.

This property may be used to adjust the appearance of the current item, for example:

ListView {
width: 180; height: 200
Component {
id: contactsDelegate
Rectangle {
id: wrapper
width: 180
height: contactInfo.height
color: ListView.isCurrentItem ? "black" : "red"
Text {
id: contactInfo
text: name + ": " + number
color: wrapper.ListView.isCurrentItem ? "red" : "black"
}
}
}
model: ContactModel {}
delegate: contactsDelegate
focus: true
}

\qmlattachedproperty ListView QtQuick::ListView::view \readonly

This attached property holds the view that manages this delegate instance.

It is attached to each instance of the delegate and also to the header, the footer, the section and the highlight delegates.

\qmlattachedproperty string QtQuick::ListView::previousSection \readonly

This attached property holds the section of the previous element.

It is attached to each instance of the delegate.

The section is evaluated using the \l {ListView::section.property}{section} properties.

\qmlattachedproperty string QtQuick::ListView::nextSection \readonly

This attached property holds the section of the next element.

It is attached to each instance of the delegate.

The section is evaluated using the \l {ListView::section.property}{section} properties.

\qmlattachedproperty string QtQuick::ListView::section \readonly

This attached property holds the section of this element.

It is attached to each instance of the delegate.

The section is evaluated using the \l {ListView::section.property}{section} properties.

\qmlattachedproperty bool QtQuick::ListView::delayRemove

This attached property holds whether the delegate may be destroyed. It is attached to each instance of the delegate. The default value is false.

It is sometimes necessary to delay the destruction of an item until an animation completes. The example delegate below ensures that the animation completes before the item is removed from the list.

Component {
id: delegate
Item {
SequentialAnimation {
id: removeAnimation
PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
}
ListView.onRemove: removeAnimation.start()
}
}

If a \l remove transition has been specified, it will not be applied until delayRemove is returned to false.

\qmlattachedsignal QtQuick::ListView::add() This attached signal is emitted immediately after an item is added to the view.

If an \l add transition is specified, it is applied immediately after this signal is handled.

\qmlattachedsignal QtQuick::ListView::remove() This attached signal is emitted immediately before an item is removed from the view.

If a \l remove transition has been specified, it is applied after this signal is handled, providing that \l delayRemove is false.

\qmlproperty model QtQuick::ListView::model This property holds the model providing data for the list.

The model provides the set of data that is used to create the items in the view. Models can be created directly in QML using \l ListModel, \l ObjectModel, or provided by C++ model classes. If a C++ model class is used, it must be a subclass of \l QAbstractItemModel or a simple list.

See also
{qml-data-models}{Data Models}

\qmlproperty Component QtQuick::ListView::delegate

The delegate provides a template defining each item instantiated by the view. The index is exposed as an accessible index property. Properties of the model are also available depending upon the type of \l {qml-data-models}{Data Model}.

The number of objects and bindings in the delegate has a direct effect on the flicking performance of the view. If at all possible, place functionality that is not needed for the normal display of the delegate in a \l Loader which can load additional components when needed.

The ListView will lay out the items based on the size of the root item in the delegate.

It is recommended that the delegate's size be a whole number to avoid sub-pixel alignment of items.

The default \l {QQuickItem::z}{stacking order} of delegate instances is 1.

Note
Delegates are instantiated as needed and may be destroyed at any time. They are parented to ListView's \l {Flickable::contentItem}{contentItem}, not to the view itself. State should never be stored in a delegate.
See also
{Stacking Order in ListView}

\qmlproperty int QtQuick::ListView::currentIndex \qmlproperty Item QtQuick::ListView::currentItem

The currentIndex property holds the index of the current item, and currentItem holds the current item. Setting the currentIndex to -1 will clear the highlight and set currentItem to null.

If highlightFollowsCurrentItem is true, setting either of these properties will smoothly scroll the ListView so that the current item becomes visible.

Note that the position of the current item may only be approximate until it becomes visible in the view.

\qmlproperty Item QtQuick::ListView::highlightItem

This holds the highlight item created from the \l highlight component.

The highlightItem is managed by the view unless \l highlightFollowsCurrentItem is set to false. The default \l {QQuickItem::z}{stacking order} of the highlight item is 0.

See also
highlight, highlightFollowsCurrentItem, {Stacking Order in ListView}

\qmlproperty int QtQuick::ListView::count The property reflects the number of items in the \l ListView's model, regardless of whether they are visible or instantiated as Item of a delegate component.

\qmlproperty bool QtQuick::ListView::reuseItems

This property enables you to reuse items that are instantiated from the \l delegate. If set to false, any currently pooled items are destroyed.

This property is false by default.

Since
5.15
See also
{Reusing items}, pooled(), reused()

\qmlattachedsignal QtQuick::ListView::pooled()

This signal is emitted after an item has been added to the reuse pool. You can use it to pause ongoing timers or animations inside the item, or free up resources that cannot be reused.

This signal is emitted only if the \l reuseItems property is true.

See also
{Reusing items}, reuseItems, reused()

\qmlattachedsignal QtQuick::ListView::reused()

This signal is emitted after an item has been reused. At this point, the item has been taken out of the pool and placed inside the content view, and the model properties such as index and row have been updated.

Other properties that are not provided by the model does not change when an item is reused. You should avoid storing any state inside a delegate, but if you do, manually reset that state on receiving this signal.

This signal is emitted when the item is reused, and not the first time the item is created.

This signal is emitted only if the \l reuseItems property is true.

See also
{Reusing items}, reuseItems, pooled()

\qmlproperty Component QtQuick::ListView::highlight This property holds the component to use as the highlight.

An instance of the highlight component is created for each list. The geometry of the resulting component instance is managed by the list so as to stay with the current item, unless the highlightFollowsCurrentItem property is false. The default \l {QQuickItem::z}{stacking order} of the highlight item is 0.

See also
highlightItem, highlightFollowsCurrentItem, {Qt Quick Examples - Views#Using Highlight}{ListView Highlight Example}, {Stacking Order in ListView}

\qmlproperty bool QtQuick::ListView::highlightFollowsCurrentItem This property holds whether the highlight is managed by the view.

If this property is true (the default value), the highlight is moved smoothly to follow the current item. Otherwise, the highlight is not moved by the view, and any movement must be implemented by the highlight.

Here is a highlight with its motion defined by a \l {SpringAnimation} item:

Component {
id: highlight
Rectangle {
width: 180; height: 40
color: "lightsteelblue"; radius: 5
y: list.currentItem.y
Behavior on y {
SpringAnimation {
spring: 3
damping: 0.2
}
}
}
}
ListView {
id: list
width: 180; height: 200
model: ContactModel {}
delegate: Text { text: name }
highlight: highlight
highlightFollowsCurrentItem: false
focus: true
}

Note that the highlight animation also affects the way that the view is scrolled. This is because the view moves to maintain the highlight within the preferred highlight range (or visible viewport).

See also
highlight, highlightMoveVelocity

\qmlproperty real QtQuick::ListView::preferredHighlightBegin \qmlproperty real QtQuick::ListView::preferredHighlightEnd \qmlproperty enumeration QtQuick::ListView::highlightRangeMode

These properties define the preferred range of the highlight (for the current item) within the view. The preferredHighlightBegin value must be less than the preferredHighlightEnd value.

These properties affect the position of the current item when the list is scrolled. For example, if the currently selected item should stay in the middle of the list when the view is scrolled, set the preferredHighlightBegin and preferredHighlightEnd values to the top and bottom coordinates of where the middle item would be. If the currentItem is changed programmatically, the list will automatically scroll so that the current item is in the middle of the view. Furthermore, the behavior of the current item index will occur whether or not a highlight exists.

Valid values for highlightRangeMode are:

\value ListView.ApplyRange the view attempts to maintain the highlight within the range. However, the highlight can move outside of the range at the ends of the list or due to mouse interaction. \value ListView.StrictlyEnforceRange the highlight never moves outside of the range. The current item changes if a keyboard or mouse action would cause the highlight to move outside of the range. \value ListView.NoHighlightRange this is the default value.

Reimplemented from QQuickItemView.

Definition at line 2539 of file qquicklistview.cpp.

◆ setHighlightMoveDuration()

void QQuickListView::setHighlightMoveDuration ( int duration)
overridevirtual

Reimplemented from QQuickItemView.

Definition at line 2891 of file qquicklistview.cpp.

◆ setHighlightMoveVelocity()

void QQuickListView::setHighlightMoveVelocity ( qreal speed)

Definition at line 2880 of file qquicklistview.cpp.

◆ setHighlightResizeDuration()

void QQuickListView::setHighlightResizeDuration ( int duration)

Definition at line 2926 of file qquicklistview.cpp.

◆ setHighlightResizeVelocity()

void QQuickListView::setHighlightResizeVelocity ( qreal speed)

Definition at line 2907 of file qquicklistview.cpp.

◆ setOrientation()

void QQuickListView::setOrientation ( QQuickListView::Orientation orientation)

Definition at line 2599 of file qquicklistview.cpp.

◆ setSnapMode()

void QQuickListView::setSnapMode ( SnapMode mode)

Definition at line 2966 of file qquicklistview.cpp.

◆ setSpacing()

void QQuickListView::setSpacing ( qreal spacing)

Definition at line 2568 of file qquicklistview.cpp.

◆ snapMode()

QQuickListView::SnapMode QQuickListView::snapMode ( ) const

\qmlproperty enumeration QtQuick::ListView::snapMode

This property determines how the view scrolling will settle following a drag or flick. The possible values are:

\value ListView.NoSnap (default) the view stops anywhere within the visible area. \value ListView.SnapToItem the view settles with an item aligned with the start of the view. \value ListView.SnapOneItem the view settles no more than one item away from the first visible item at the time the mouse button is released. This mode is particularly useful for moving one page at a time. When SnapOneItem is enabled, the ListView will show a stronger affinity to neighboring items when movement occurs. For example, a short drag that snaps back to the current item with SnapToItem might snap to a neighboring item with SnapOneItem.

snapMode does not affect the \l currentIndex. To update the \l currentIndex as the list is moved, set \l highlightRangeMode to ListView.StrictlyEnforceRange.

See also
highlightRangeMode

Definition at line 2960 of file qquicklistview.cpp.

◆ snapModeChanged

void QQuickListView::snapModeChanged ( )
signal

◆ spacing()

qreal QQuickListView::spacing ( ) const

\qmlproperty real QtQuick::ListView::spacing

This property holds the spacing between items.

The default value is 0.

Definition at line 2562 of file qquicklistview.cpp.

◆ spacingChanged

void QQuickListView::spacingChanged ( )
signal

◆ viewportMoved()

void QQuickListView::viewportMoved ( Qt::Orientations orient)
overrideprotectedvirtual

\qmlproperty Transition QtQuick::ListView::populate

This property holds the transition to apply to the items that are initially created for a view.

It is applied to all items that are created when:

\list

For example, here is a view that specifies such a transition:

ListView {
...
populate: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}
static const QCssKnownValue properties[NumProperties - 1]

When the view is initialized, the view will create all the necessary items for the view, then animate them to their correct positions within the view over one second.

However when scrolling the view later, the populate transition does not run, even though delegates are being instantiated as they become visible. When the model changes in a way that new delegates become visible, the \l add transition is the one that runs. So you should not depend on the populate transition to initialize properties in the delegate, because it does not apply to every delegate. If your animation sets the to value of a property, the property should initially have the to value, and the animation should set the from value in case it is animated:

ListView {
...
delegate: Rectangle {
opacity: 1 // not necessary because it's the default
}
populate: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 1000 }
}
}
QQmlComponent * delegate
qreal opacity
\qmlproperty real QtQuick::Item::opacity
Definition qquickitem.h:78
const char property[13]
Definition qwizard.cpp:100

For more details and examples on how to use view transitions, see the ViewTransition documentation.

See also
add, ViewTransition

\qmlproperty Transition QtQuick::ListView::add

This property holds the transition to apply to items that are added to the view.

For example, here is a view that specifies such a transition:

ListView {
...
add: Transition {
NumberAnimation { properties: "x,y"; from: 100; duration: 1000 }
}
}
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)

Whenever an item is added to the above view, the item will be animated from the position (100,100) to its final x,y position within the view, over one second. The transition only applies to the new items that are added to the view; it does not apply to the items below that are displaced by the addition of the new items. To animate the displaced items, set the \l displaced or \l addDisplaced properties.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

Note
This transition is not applied to the items that are created when the view is initially populated, or when the view's \l model changes. (In those cases, the \l populate transition is applied instead.) Additionally, this transition should not animate the height of the new item; doing so will cause any items beneath the new item to be laid out at the wrong position. Instead, the height can be animated within the \l {add}{onAdd} handler in the delegate.
See also
addDisplaced, populate, ViewTransition

\qmlproperty Transition QtQuick::ListView::addDisplaced

This property holds the transition to apply to items within the view that are displaced by the addition of other items to the view.

For example, here is a view that specifies such a transition:

ListView {
...
addDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}

Whenever an item is added to the above view, all items beneath the new item are displaced, causing them to move down (or sideways, if horizontally orientated) within the view. As this displacement occurs, the items' movement to their new x,y positions within the view will be animated by a NumberAnimation over one second, as specified. This transition is not applied to the new item that has been added to the view; to animate the added items, set the \l add property.

If an item is displaced by multiple types of operations at the same time, it is not defined as to whether the addDisplaced, moveDisplaced or removeDisplaced transition will be applied. Additionally, if it is not necessary to specify different transitions depending on whether an item is displaced by an add, move or remove operation, consider setting the \l displaced property instead.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

Note
This transition is not applied to the items that are created when the view is initially populated, or when the view's \l model changes. In those cases, the \l populate transition is applied instead.
See also
displaced, add, populate, ViewTransition

\qmlproperty Transition QtQuick::ListView::move

This property holds the transition to apply to items in the view that are being moved due to a move operation in the view's \l model.

For example, here is a view that specifies such a transition:

ListView {
...
move: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}

Whenever the \l model performs a move operation to move a particular set of indexes, the respective items in the view will be animated to their new positions in the view over one second. The transition only applies to the items that are the subject of the move operation in the model; it does not apply to items below them that are displaced by the move operation. To animate the displaced items, set the \l displaced or \l moveDisplaced properties.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

See also
moveDisplaced, ViewTransition

\qmlproperty Transition QtQuick::ListView::moveDisplaced

This property holds the transition to apply to items that are displaced by a move operation in the view's \l model.

For example, here is a view that specifies such a transition:

ListView {
...
moveDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}

Whenever the \l model performs a move operation to move a particular set of indexes, the items between the source and destination indexes of the move operation are displaced, causing them to move upwards or downwards (or sideways, if horizontally orientated) within the view. As this displacement occurs, the items' movement to their new x,y positions within the view will be animated by a NumberAnimation over one second, as specified. This transition is not applied to the items that are the actual subjects of the move operation; to animate the moved items, set the \l move property.

If an item is displaced by multiple types of operations at the same time, it is not defined as to whether the addDisplaced, moveDisplaced or removeDisplaced transition will be applied. Additionally, if it is not necessary to specify different transitions depending on whether an item is displaced by an add, move or remove operation, consider setting the \l displaced property instead.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

See also
displaced, move, ViewTransition

\qmlproperty Transition QtQuick::ListView::remove

This property holds the transition to apply to items that are removed from the view.

For example, here is a view that specifies such a transition:

ListView {
...
remove: Transition {
ParallelAnimation {
NumberAnimation { property: "opacity"; to: 0; duration: 1000 }
NumberAnimation { properties: "x,y"; to: 100; duration: 1000 }
}
}
}
settings remove("monkey")

Whenever an item is removed from the above view, the item will be animated to the position (100,100) over one second, and in parallel will also change its opacity to 0. The transition only applies to the items that are removed from the view; it does not apply to the items below them that are displaced by the removal of the items. To animate the displaced items, set the \l displaced or \l removeDisplaced properties.

Note that by the time the transition is applied, the item has already been removed from the model; any references to the model data for the removed index will not be valid.

Additionally, if the \l delayRemove attached property has been set for a delegate item, the remove transition will not be applied until \l delayRemove becomes false again.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

See also
removeDisplaced, ViewTransition

\qmlproperty Transition QtQuick::ListView::removeDisplaced

This property holds the transition to apply to items in the view that are displaced by the removal of other items in the view.

For example, here is a view that specifies such a transition:

ListView {
...
removeDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}

Whenever an item is removed from the above view, all items beneath it are displaced, causing them to move upwards (or sideways, if horizontally orientated) within the view. As this displacement occurs, the items' movement to their new x,y positions within the view will be animated by a NumberAnimation over one second, as specified. This transition is not applied to the item that has actually been removed from the view; to animate the removed items, set the \l remove property.

If an item is displaced by multiple types of operations at the same time, it is not defined as to whether the addDisplaced, moveDisplaced or removeDisplaced transition will be applied. Additionally, if it is not necessary to specify different transitions depending on whether an item is displaced by an add, move or remove operation, consider setting the \l displaced property instead.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

See also
displaced, remove, ViewTransition

\qmlproperty Transition QtQuick::ListView::displaced This property holds the generic transition to apply to items that have been displaced by any model operation that affects the view.

This is a convenience for specifying the generic transition to be applied to any items that are displaced by an add, move or remove operation, without having to specify the individual addDisplaced, moveDisplaced and removeDisplaced properties. For example, here is a view that specifies a displaced transition:

ListView {
...
displaced: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}

When any item is added, moved or removed within the above view, the items below it are displaced, causing them to move down (or sideways, if horizontally orientated) within the view. As this displacement occurs, the items' movement to their new x,y positions within the view will be animated by a NumberAnimation over one second, as specified.

If a view specifies this generic displaced transition as well as a specific addDisplaced, moveDisplaced or removeDisplaced transition, the more specific transition will be used instead of the generic displaced transition when the relevant operation occurs, providing that the more specific transition has not been disabled (by setting \l {Transition::enabled}{enabled} to false). If it has indeed been disabled, the generic displaced transition is applied instead.

For more details and examples on how to use view transitions, see the ViewTransition documentation.

See also
addDisplaced, moveDisplaced, removeDisplaced, ViewTransition

Reimplemented from QQuickFlickable.

Definition at line 3418 of file qquicklistview.cpp.

Property Documentation

◆ currentSection

QString QQuickListView::currentSection
read

Definition at line 93 of file qquicklistview_p.h.

◆ footerPositioning

FooterPositioning QQuickListView::footerPositioning
readwrite

Definition at line 98 of file qquicklistview_p.h.

◆ headerPositioning

HeaderPositioning QQuickListView::headerPositioning
readwrite

Definition at line 97 of file qquicklistview_p.h.

◆ highlightMoveVelocity

qreal QQuickListView::highlightMoveVelocity
readwrite

Definition at line 85 of file qquicklistview_p.h.

◆ highlightResizeDuration

int QQuickListView::highlightResizeDuration
readwrite

Definition at line 87 of file qquicklistview_p.h.

◆ highlightResizeVelocity

qreal QQuickListView::highlightResizeVelocity
readwrite

Definition at line 86 of file qquicklistview_p.h.

◆ orientation

Orientation QQuickListView::orientation
readwrite

Definition at line 90 of file qquicklistview_p.h.

◆ section

QQuickViewSection * QQuickListView::section
read

Definition at line 92 of file qquicklistview_p.h.

◆ snapMode

SnapMode QQuickListView::snapMode
readwrite

Definition at line 95 of file qquicklistview_p.h.

◆ spacing

qreal QQuickListView::spacing
readwrite

Definition at line 89 of file qquicklistview_p.h.


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