Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.1.1, 5.7
-
None
Description
The count property of the Repeater item is supposed to hold the number of items in the Repeater, but that is not true while the items are being created and may be whilst being deleted. See QTBUG-33474. I have attached a test case that will crash when CRASH_ENABLED is set to 1. Essentially I have registered a custom type, and I am using a QML Repeater to add a number of the children to it.
The code for the Repeater::count is:
int QQuickRepeater::count() const
{ Q_D(const QQuickRepeater); if (d->model) return d->model->count(); return 0; }the code for itemAt is
QQuickItem *QQuickRepeater::itemAt(int index) const
{ Q_D(const QQuickRepeater); if (index >= 0 && index < d->deletables.count()) return d->deletables[index]; return 0; }Somehow the model is out of step with the delegate list. It may be better for count to return the delegate list's count.