diff options
author | Hatem ElKharashy <hatem.elkharashy@qt.io> | 2024-04-09 13:44:45 +0300 |
---|---|---|
committer | Hatem ElKharashy <hatem.elkharashy@qt.io> | 2024-04-13 08:24:31 +0000 |
commit | a35950db9523ab910feb8622f97432ee4482de83 (patch) | |
tree | 294da1a5a11575c18522c2e63ccc98e533f6cd2a /src/quick/items/qquickgridview.cpp | |
parent | f59bac55c89733bc9db3a6f715c294bfb499e823 (diff) |
GridView: add missing properties and signals to the documentation
reuseItems, pooled(), and reused() can be used in GridView as well,
since QQuickGridView and QQuickListView both inherits from
QQuickItemView.
Fixes: QTBUG-122250
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Ie9875f5b3abd98f9b14134d06fbfce0286d56444
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/items/qquickgridview.cpp')
-rw-r--r-- | src/quick/items/qquickgridview.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp index 09cc35a24f..25ef44ecb0 100644 --- a/src/quick/items/qquickgridview.cpp +++ b/src/quick/items/qquickgridview.cpp @@ -1385,6 +1385,50 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight) This property holds the number of items in the view. */ +/*! + \qmlproperty bool QtQuick::GridView::reuseItems + + This property enables you to reuse items that are instantiated + from the \l delegate. If set to \c false, any currently + pooled items are destroyed. + + This property is \c false by default. + + \since 5.15 + + \sa {Reusing items}, pooled(), reused() +*/ + +/*! + \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 \c true. + + \sa {Reusing items}, reuseItems, reused() +*/ + +/*! + \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 \c index and \c 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 \c true. + + \sa {Reusing items}, reuseItems, pooled() +*/ /*! \qmlproperty Component QtQuick::GridView::highlight |