Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qquicklistview_p.h>
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 | |
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) |
QQuickViewSection * | sectionCriteria () |
\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 &) |
QQmlComponent * | delegate () const |
void | setDelegate (QQmlComponent *) |
int | count () const |
int | currentIndex () const |
void | setCurrentIndex (int idx) |
QQuickItem * | currentItem () 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) |
QQmlComponent * | footer () const |
void | setFooter (QQmlComponent *) |
QQuickItem * | footerItem () const |
QQmlComponent * | header () const |
void | setHeader (QQmlComponent *) |
QQuickItem * | headerItem () const |
QQmlComponent * | highlight () const |
void | setHighlight (QQmlComponent *) |
QQuickItem * | highlightItem () 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 QQuickItem * | itemAt (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< QObject > | flickableData () |
QQmlListProperty< QQuickItem > | flickableChildren () |
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) |
QQuickTransition * | rebound () 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 |
QQuickItem * | contentItem () 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. | |
QQuickWindow * | window () const |
Returns the window in which this item is rendered. | |
QQuickItem * | parentItem () 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< QQuickTransform > | transform () |
qreal | x () const |
qreal | y () const |
QPointF | position () const |
void | setX (qreal) |
void | setY (qreal) |
void | setPosition (const QPointF &) |
QBindable< qreal > | bindableX () |
QBindable< qreal > | bindableY () |
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< qreal > | bindableWidth () |
qreal | height () const |
void | setHeight (qreal) |
void | resetHeight () |
void | setImplicitHeight (qreal) |
qreal | implicitHeight () const |
QBindable< qreal > | bindableHeight () |
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(). | |
QQuickItem * | viewportItem () 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. | |
QQuickItem * | scopedFocusItem () 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< QQuickItemGrabResult > | grabToImage (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) | |
QObject * | containmentMask () 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 QQuickItem * | childAt (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 QSGTextureProvider * | textureProvider () 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< QString > | bindableObjectName () |
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). | |
QThread * | thread () 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 > | |
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 > | |
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 QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () 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 QQuickListViewAttached * | qmlAttachedProperties (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. | |
QQuickFlickableVisibleArea * | visibleArea () |
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 QSGNode * | updatePaintNode (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 | |
QObject * | sender () 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) | |
Additional Inherited Members | |
Public Attributes inherited from QQuickItem | |
const QSize & | targetSize = 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 | |
QObject * | object |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 80 of file qquicklistview_p.h.
Enumerator | |
---|---|
InlineFooter | |
OverlayFooter | |
PullBackFooter |
Definition at line 143 of file qquicklistview_p.h.
Enumerator | |
---|---|
InlineHeader | |
OverlayHeader | |
PullBackHeader |
Definition at line 138 of file qquicklistview_p.h.
Enumerator | |
---|---|
Horizontal | |
Vertical |
Definition at line 112 of file qquicklistview_p.h.
Enumerator | |
---|---|
NoSnap | |
SnapToItem | |
SnapOneItem |
Definition at line 133 of file qquicklistview_p.h.
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.
Definition at line 2261 of file qquicklistview.cpp.
QQuickListView::~QQuickListView | ( | ) |
Definition at line 2266 of file qquicklistview.cpp.
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.
|
signal |
|
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.
QQuickListView::FooterPositioning QQuickListView::footerPositioning | ( | ) | const |
\qmlproperty enumeration QtQuick::ListView::footerPositioning
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.
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}.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.
|
overrideprotectedvirtual |
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.
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
.
\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
.
\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
.
\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
.
\qmlproperty enumeration QtQuick::ListView::headerPositioning
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.
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}.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.
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:
Definition at line 2874 of file qquicklistview.cpp.
|
signal |
int QQuickListView::highlightResizeDuration | ( | ) | const |
Definition at line 2920 of file qquicklistview.cpp.
|
signal |
qreal QQuickListView::highlightResizeVelocity | ( | ) | const |
Definition at line 2901 of file qquicklistview.cpp.
|
signal |
|
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.
Reimplemented from QQuickItemView.
Definition at line 3587 of file qquicklistview.cpp.
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.
|
overrideprotectedvirtual |
Reimplemented from QQuickItemView.
Definition at line 3610 of file qquicklistview.cpp.
|
overrideprotectedvirtual |
Reimplemented from QQuickItemView.
Definition at line 3602 of file qquicklistview.cpp.
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
Definition at line 2593 of file qquicklistview.cpp.
|
signal |
|
signal |
|
signal |
|
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:
\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:
\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.
\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.
Note: methods should only be called after the Component has completed.
Definition at line 4008 of file qquicklistview.cpp.
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.
\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.
\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.
\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
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.
\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.
The cacheBuffer operates outside of any display margins specified by displayMarginBeginning or displayMarginEnd.
\qmlproperty int QtQuick::ListView::displayMarginBeginning \qmlproperty int QtQuick::ListView::displayMarginEnd
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.
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.
Definition at line 2820 of file qquicklistview.cpp.
void QQuickListView::setFooterPositioning | ( | QQuickListView::FooterPositioning | positioning | ) |
Definition at line 3101 of file qquicklistview.cpp.
void QQuickListView::setHeaderPositioning | ( | QQuickListView::HeaderPositioning | positioning | ) |
Definition at line 3054 of file qquicklistview.cpp.
|
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:
\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.
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.
\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
.
\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
.
\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.
\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
.
\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
.
\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
.
\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:
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).
\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.
|
overridevirtual |
Reimplemented from QQuickItemView.
Definition at line 2891 of file qquicklistview.cpp.
Definition at line 2880 of file qquicklistview.cpp.
void QQuickListView::setHighlightResizeDuration | ( | int | duration | ) |
Definition at line 2926 of file qquicklistview.cpp.
Definition at line 2907 of file qquicklistview.cpp.
void QQuickListView::setOrientation | ( | QQuickListView::Orientation | orientation | ) |
Definition at line 2599 of file qquicklistview.cpp.
Definition at line 2966 of file qquicklistview.cpp.
Definition at line 2568 of file qquicklistview.cpp.
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
.
Definition at line 2960 of file qquicklistview.cpp.
|
signal |
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.
|
signal |
|
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:
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:
For more details and examples on how to use view transitions, see the ViewTransition documentation.
\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:
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.
\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:
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.
\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:
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.
\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:
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.
\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:
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.
\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:
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.
\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:
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.
Reimplemented from QQuickFlickable.
Definition at line 3418 of file qquicklistview.cpp.
|
read |
Definition at line 93 of file qquicklistview_p.h.
|
readwrite |
Definition at line 98 of file qquicklistview_p.h.
|
readwrite |
Definition at line 97 of file qquicklistview_p.h.
|
readwrite |
Definition at line 85 of file qquicklistview_p.h.
|
readwrite |
Definition at line 87 of file qquicklistview_p.h.
|
readwrite |
Definition at line 86 of file qquicklistview_p.h.
|
readwrite |
Definition at line 90 of file qquicklistview_p.h.
|
read |
Definition at line 92 of file qquicklistview_p.h.
|
readwrite |
Definition at line 95 of file qquicklistview_p.h.
|
readwrite |
Definition at line 89 of file qquicklistview_p.h.