Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qquickgridview_p.h>
Public Slots | |
void | moveCurrentIndexUp () |
\qmlmethod QtQuick::GridView::moveCurrentIndexUp() | |
void | moveCurrentIndexDown () |
\qmlmethod QtQuick::GridView::moveCurrentIndexDown() | |
void | moveCurrentIndexLeft () |
\qmlmethod QtQuick::GridView::moveCurrentIndexLeft() | |
void | moveCurrentIndexRight () |
\qmlmethod QtQuick::GridView::moveCurrentIndexRight() | |
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 | |
QQuickGridView (QQuickItem *parent=nullptr) | |
\qmltype GridView \nativetype QQuickGridView \inqmlmodule QtQuick | |
void | setHighlightFollowsCurrentItem (bool) override |
void | setHighlightMoveDuration (int) override |
\qmlattachedproperty bool QtQuick::GridView::isCurrentItem \readonly | |
Flow | flow () const |
\qmlproperty enumeration QtQuick::GridView::flow This property holds the flow of the grid. | |
void | setFlow (Flow) |
qreal | cellWidth () const |
\qmlproperty real QtQuick::GridView::cellWidth \qmlproperty real QtQuick::GridView::cellHeight | |
void | setCellWidth (qreal) |
qreal | cellHeight () const |
void | setCellHeight (qreal) |
SnapMode | snapMode () const |
\qmlproperty enumeration QtQuick::GridView::snapMode | |
void | setSnapMode (SnapMode mode) |
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 QQuickGridViewAttached * | qmlAttachedProperties (QObject *) |
\qmlmethod QtQuick::GridView::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) override |
\qmlproperty Component QtQuick::GridView::footer This property holds the component to use as the footer. | |
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 |
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. | |
void | geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry) override |
qreal | minYExtent () const override |
qreal | maxYExtent () const override |
qreal | minXExtent () const override |
qreal | maxXExtent () 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) | |
Properties | |
Flow | flow |
qreal | cellWidth |
qreal | cellHeight |
SnapMode | snapMode |
Properties inherited from QQuickItemView | |
QVariant | model |
QQmlComponent * | delegate |
int | count |
int | currentIndex |
QQuickItem * | currentItem |
bool | keyNavigationWraps |
bool | keyNavigationEnabled |
int | cacheBuffer |
int | displayMarginBeginning |
int | displayMarginEnd |
Qt::LayoutDirection | layoutDirection |
Qt::LayoutDirection | effectiveLayoutDirection |
VerticalLayoutDirection | verticalLayoutDirection |
QQmlComponent * | header |
QQuickItem * | headerItem |
QQmlComponent * | footer |
QQuickItem * | footerItem |
QQmlComponent * | highlight |
QQuickItem * | highlightItem |
bool | highlightFollowsCurrentItem |
HighlightRangeMode | highlightRangeMode |
qreal | preferredHighlightBegin |
qreal | preferredHighlightEnd |
int | highlightMoveDuration |
bool | reuseItems |
Properties inherited from QQuickFlickable | |
qreal | contentWidth |
qreal | contentHeight |
qreal | contentX |
qreal | contentY |
QQuickItem * | contentItem |
qreal | topMargin |
qreal | bottomMargin |
qreal | originY |
qreal | leftMargin |
qreal | rightMargin |
qreal | originX |
qreal | horizontalVelocity |
qreal | verticalVelocity |
BoundsBehavior | boundsBehavior |
BoundsMovement | boundsMovement |
QQuickTransition * | rebound |
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 |
QQuickFlickableVisibleArea * | visibleArea |
bool | pixelAligned |
bool | synchronousDrag |
qreal | horizontalOvershoot |
qreal | verticalOvershoot |
Qt::MouseButtons | acceptedButtons |
FINALQQmlListProperty< QObject > | flickableData |
QQmlListProperty< QQuickItem > | flickableChildren |
Properties inherited from QQuickItem | |
QQuickItem * | parent |
\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< QQuickTransform > | transform |
\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 |
QObject * | containmentMask |
\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 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 28 of file qquickgridview_p.h.
enum QQuickGridView::Flow |
Enumerator | |
---|---|
FlowLeftToRight | |
FlowTopToBottom |
Definition at line 45 of file qquickgridview_p.h.
Enumerator | |
---|---|
NoSnap | |
SnapToRow | |
SnapOneRow |
Definition at line 65 of file qquickgridview_p.h.
QQuickGridView::QQuickGridView | ( | QQuickItem * | parent = nullptr | ) |
\qmltype GridView \nativetype QQuickGridView \inqmlmodule QtQuick
\inherits Flickable
For specifying a grid view of items provided by a model.
A GridView displays data from models created from built-in QML types like ListModel and XmlListModel, or custom model classes defined in C++ that inherit from QAbstractListModel.
A GridView 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 GridView are laid out horizontally or vertically. Grid views are inherently flickable as GridView inherits from \l Flickable.
Definition at line 1258 of file qquickgridview.cpp.
qreal QQuickGridView::cellHeight | ( | ) | const |
Definition at line 1710 of file qquickgridview.cpp.
|
signal |
qreal QQuickGridView::cellWidth | ( | ) | const |
\qmlproperty real QtQuick::GridView::cellWidth \qmlproperty real QtQuick::GridView::cellHeight
These properties holds the width and height of each cell in the grid.
The default cell size is 100x100.
Definition at line 1692 of file qquickgridview.cpp.
|
signal |
QQuickGridView::Flow QQuickGridView::flow | ( | ) | const |
\qmlproperty enumeration QtQuick::GridView::flow This property holds the flow of the grid.
Possible values:
\value GridView.FlowLeftToRight (default) Items are laid out from left to right, and the view scrolls vertically \value GridView.FlowTopToBottom Items are laid out from top to bottom, and the view scrolls horizontally
Definition at line 1658 of file qquickgridview.cpp.
|
signal |
|
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 QQuickFlickable.
Definition at line 2210 of file qquickgridview.cpp.
|
signal |
Reimplemented from QQuickItemView.
Definition at line 2227 of file qquickgridview.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 2178 of file qquickgridview.cpp.
|
slot |
\qmlmethod QtQuick::GridView::moveCurrentIndexDown()
Move the currentIndex down one item in the view. 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 2295 of file qquickgridview.cpp.
|
slot |
\qmlmethod QtQuick::GridView::moveCurrentIndexLeft()
Move the currentIndex left one item in the view. 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 2338 of file qquickgridview.cpp.
|
slot |
\qmlmethod QtQuick::GridView::moveCurrentIndexRight()
Move the currentIndex right one item in the view. 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 2381 of file qquickgridview.cpp.
|
slot |
\qmlmethod QtQuick::GridView::moveCurrentIndexUp()
Move the currentIndex up one item in the view. 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 2253 of file qquickgridview.cpp.
|
static |
\qmlmethod QtQuick::GridView::positionViewAtIndex(int index, PositionMode mode)
Positions the view such that the index is at the position specified by mode:
\value GridView.Beginning position item at the top (or left for GridView.FlowTopToBottom
flow) of the view. \value GridView.Center position item in the center of the view. \value GridView.End position item at bottom (or right for horizontal orientation) of the view. \value GridView.Visible if any part of the item is visible then take no action, otherwise bring the item into view. \value GridView.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 GridView.FlowTopToBottom
flow) of the view. \value GridView.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 the 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 view does not cause all other items to be repositioned. 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::GridView::positionViewAtBeginning() \qmlmethod QtQuick::GridView::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::GridView::indexAt(real x, real y)
Returns the index of the visible item containing the point x, y in \l {QQuickFlickable::contentItem}{content item} 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::GridView::itemAt(real x, real y)
Returns the visible item containing the point x, y in \l {QQuickFlickable::contentItem}{content item} 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::GridView::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::GridView::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 GridView has not caught up yet.
This method forces the GridView to immediately respond to any outstanding changes in the model.
Note: methods should only be called after the Component has completed.
Definition at line 2778 of file qquickgridview.cpp.
Definition at line 1716 of file qquickgridview.cpp.
Definition at line 1698 of file qquickgridview.cpp.
Definition at line 1664 of file qquickgridview.cpp.
|
overridevirtual |
Reimplemented from QQuickItemView.
Definition at line 1263 of file qquickgridview.cpp.
|
overridevirtual |
\qmlattachedproperty bool QtQuick::GridView::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.
\qmlattachedproperty GridView QtQuick::GridView::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 and the highlight delegates.
\qmlattachedproperty bool QtQuick::GridView::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::GridView::add() This attached signal is emitted immediately after an item is added to the view.
\qmlattachedsignal QtQuick::GridView::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::GridView::model This property holds the model providing data for the grid.
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 DelegateModel, \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::GridView::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 item size of the GridView is determined by cellHeight and cellWidth. It will not resize the items based on the size of the root item in the delegate.
The default \l {QQuickItem::z}{stacking order} of delegate instances is 1
.
\qmlproperty int QtQuick::GridView::currentIndex \qmlproperty Item QtQuick::GridView::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 GridView 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::GridView::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::GridView::count This property holds the number of items in the model.
\qmlproperty bool QtQuick::GridView::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::GridView::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::GridView::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::GridView::highlight This property holds the component to use as the highlight.
An instance of the highlight component is created for each view. The geometry of the resulting component instance will be managed by the view 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::GridView::highlightFollowsCurrentItem This property sets 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:
\qmlproperty int QtQuick::GridView::highlightMoveDuration This property holds the move animation duration of the highlight delegate.
highlightFollowsCurrentItem must be true for this property to have effect.
The default value for the duration is 150ms.
\qmlproperty real QtQuick::GridView::preferredHighlightBegin \qmlproperty real QtQuick::GridView::preferredHighlightEnd \qmlproperty enumeration QtQuick::GridView::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 view is scrolled. For example, if the currently selected item should stay in the middle of the view when it 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 view 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 GridView.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 view or due to mouse interaction. \value GridView.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 GridView.NoHighlightRange the default value
\qmlproperty enumeration QtQuick::GridView::layoutDirection This property holds the layout direction of the grid.
Possible values:
\value Qt.LeftToRight (default) Items will be laid out starting in the top, left corner. The flow is dependent on the \l GridView::flow property. \value Qt.RightToLeft Items will be laid out starting in the top, right corner. The flow is dependent on the \l GridView::flow property.
Note: If GridView::flow is set to GridView.FlowLeftToRight, this is not to be confused if GridView::layoutDirection is set to Qt.RightToLeft. The GridView.FlowLeftToRight flow value simply indicates that the flow is horizontal.
\qmlproperty enumeration QtQuick::GridView::effectiveLayoutDirection This property holds the effective layout direction of the grid.
When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, the visual layout direction of the grid will be mirrored. However, the property \l {GridView::layoutDirection}{layoutDirection} will remain unchanged.
\qmlproperty enumeration QtQuick::GridView::verticalLayoutDirection This property holds the vertical layout direction of the grid.
Possible values:
\value GridView.TopToBottom (default) Items are laid out from the top of the view down to the bottom of the view. \value GridView.BottomToTop Items are laid out from the bottom of the view up to the top of the view.
\qmlproperty bool QtQuick::GridView::keyNavigationWraps This property holds whether the grid wraps key navigation
If this is true, key navigation that would move the current item selection past one end of the view instead wraps around and moves the selection to the other end of the view.
By default, key navigation is not wrapped.
\qmlproperty bool QtQuick::GridView::keyNavigationEnabled
This property holds whether the key navigation of the grid 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::GridView::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 will fit within the buffer specified. For example, if in a vertical view the delegate is 20 pixels high, there are 3 columns and cacheBuffer
is set to 40, then up to 6 delegates above and 6 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::GridView::displayMarginBeginning \qmlproperty int QtQuick::GridView::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, there are 3 columns, and displayMarginBeginning
and displayMarginEnd
are both set to 40, then 6 delegates above and 6 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.
Reimplemented from QQuickItemView.
Definition at line 1637 of file qquickgridview.cpp.
Definition at line 1746 of file qquickgridview.cpp.
QQuickGridView::SnapMode QQuickGridView::snapMode | ( | ) | const |
\qmlproperty enumeration QtQuick::GridView::snapMode
This property determines how the view scrolling will settle following a drag or flick. The possible values are:
\value GridView.NoSnap (default) the view stops anywhere within the visible area. \value GridView.SnapToRow the view settles with a row (or column for GridView.FlowTopToBottom
flow) aligned with the start of the view. \value GridView.SnapOneRow the view will settle no more than one row (or column for GridView.FlowTopToBottom
flow) away from the first visible row at the time the mouse button is released. This mode is particularly useful for moving one page at a time.
Definition at line 1740 of file qquickgridview.cpp.
|
signal |
|
overrideprotectedvirtual |
\qmlproperty Component QtQuick::GridView::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::GridView::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::GridView::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::GridView::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 Transition QtQuick::GridView::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::GridView::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::GridView::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::GridView::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::GridView::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::GridView::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::GridView::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::GridView::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 a generic transition for items that are displaced by add, move or remove operations, 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 2101 of file qquickgridview.cpp.
|
readwrite |
Definition at line 35 of file qquickgridview_p.h.
|
readwrite |
Definition at line 34 of file qquickgridview_p.h.
|
readwrite |
Definition at line 33 of file qquickgridview_p.h.
|
readwrite |
Definition at line 37 of file qquickgridview_p.h.