@@ -32,13 +32,12 @@ private:
3232 void verifyItem(int visibleIndex, qreal pos, qreal height, bool culled, const QString §ionHeader, bool sectionHeaderCulled)
3333 {
3434 QTRY_VERIFY(visibleIndex < lvwph->m_visibleItems.count());
35− ListViewWithPageHeader::ListItem *item = lvwph->m_visibleItems[visibleIndex];
36− QTRY_COMPARE(item->y(), pos);
37− QTRY_COMPARE(item->height(), height);
38− QCOMPARE(QQuickItemPrivate::get(item->m_item)->culled, culled);
39− QCOMPARE(section(item->m_sectionItem), sectionHeader);
35+ QTRY_COMPARE(lvwph->m_visibleItems[visibleIndex]->y(), pos);
36+ QTRY_COMPARE(lvwph->m_visibleItems[visibleIndex]->height(), height);
37+ QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_item)->culled, culled);
38+ QCOMPARE(section(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), sectionHeader);
4039 if (!sectionHeader.isNull()) {
41− QCOMPARE(QQuickItemPrivate::get(item->m_sectionItem)->culled, sectionHeaderCulled);
40+ QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_sectionItem)->culled, sectionHeaderCulled);
4241 }
4342 }
4443
@@ -1266,6 +1265,26 @@ private Q_SLOTS:
12661265 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
12671266 }
12681267
1268+ void testAddSecondToCulledCategoryOfTwo()
1269+ {
1270+ // Do some setup
1271+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 25), Q_ARG(QVariant, "Agressive"));
1272+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 25), Q_ARG(QVariant, "Agressive"));
1273+
1274+ changeContentY(200);
1275+
1276+ // Very the items are culled
1277+ verifyItem(0, -150., 65., true, "Agressive", true);
1278+ verifyItem(1, -85, 25., true, QString(), true);
1279+
1280+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 25), Q_ARG(QVariant, "Agressive"));
1281+
1282+ // Very the new item is there correctly
1283+ verifyItem(0, -175., 65., true, "Agressive", true);
1284+ verifyItem(1, -110, 25., true, QString(), true);
1285+ verifyItem(2, -85, 25., true, QString(), true);
1286+ }
1287+
12691288 void testMoveFirstItems()
12701289 {
12711290 QMetaObject::invokeMethod(model, "moveItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 1), Q_ARG(QVariant, 1));