diff options
author | Hatem ElKharashy <hatem.elkharashy@qt.io> | 2024-04-09 13:44:45 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-04-13 10:38:52 +0000 |
commit | d34f33c3fd48850a11dbdc33a9ced030faea69ba (patch) | |
tree | 451bb5af5059646e23cbd3d0dce71eab08d380cf | |
parent | 9029a92fb3b27f2cbaf8156e41ece62c423a7fc3 (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.5 6.2 5.15
Change-Id: Ie9875f5b3abd98f9b14134d06fbfce0286d56444
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit a35950db9523ab910feb8622f97432ee4482de83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 |