aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickrepeater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickrepeater.cpp')
-rw-r--r--src/quick/items/qquickrepeater.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index 20603720c5..6dc735d20b 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -417,6 +417,12 @@ void QQuickRepeater::createdItem(int index, QObject *)
void QQuickRepeater::initItem(int index, QObject *object)
{
Q_D(QQuickRepeater);
+ if (index >= d->deletables.size()) {
+ // this can happen when Package is used
+ // calling regenerate does too much work, all we need is to call resize
+ // so that d->deletables[index] = item below works
+ d->deletables.resize(d->model->count() + 1);
+ }
QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
if (!d->deletables.at(index)) {