}
}
+ // update visibleIndex
+ d->visibleIndex = 0;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
// fix current
if (d->currentIndex >= modelIndex + count) {
d->currentIndex -= count;
emit currentIndexChanged();
}
- // update visibleIndex
- d->visibleIndex = 0;
- for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
- if ((*it)->index != -1) {
- d->visibleIndex = (*it)->index;
- break;
- }
- }
-
if (removedVisible && d->visibleItems.isEmpty()) {
d->timeline.clear();
if (d->itemCount == 0) {
if (firstVisible && d->visibleItems.first() != firstVisible)
static_cast<FxListItemSG*>(d->visibleItems.first())->setPosition(d->visibleItems.first()->position() + preRemovedSize);
+ // update visibleIndex
+ bool haveVisibleIndex = false;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ haveVisibleIndex = true;
+ break;
+ }
+ }
+
// fix current
if (d->currentIndex >= modelIndex + count) {
d->currentIndex -= count;
emit currentIndexChanged();
}
- // update visibleIndex
- bool haveVisibleIndex = false;
- for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
- if ((*it)->index != -1) {
- d->visibleIndex = (*it)->index;
- haveVisibleIndex = true;
- break;
- }
- }
-
if (!haveVisibleIndex) {
d->timeline.clear();
if (removedVisible && d->itemCount == 0) {
}
}
+ // update visibleIndex
+ d->visibleIndex = 0;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
// fix current
if (d->currentIndex >= modelIndex + count) {
d->currentIndex -= count;
emit currentIndexChanged();
}
- // update visibleIndex
- d->visibleIndex = 0;
- for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
- if ((*it)->index != -1) {
- d->visibleIndex = (*it)->index;
- break;
- }
- }
-
if (removedVisible && d->visibleItems.isEmpty()) {
d->timeline.clear();
if (d->itemCount == 0) {
if (firstVisible && d->visibleItems.first() != firstVisible)
d->visibleItems.first()->setPosition(d->visibleItems.first()->position() + preRemovedSize);
+ // update visibleIndex
+ bool haveVisibleIndex = false;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ haveVisibleIndex = true;
+ break;
+ }
+ }
+
// fix current
if (d->currentIndex >= modelIndex + count) {
d->currentIndex -= count;
emit currentIndexChanged();
}
- // update visibleIndex
- bool haveVisibleIndex = false;
- for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
- if ((*it)->index != -1) {
- d->visibleIndex = (*it)->index;
- haveVisibleIndex = true;
- break;
- }
- }
-
if (!haveVisibleIndex) {
d->timeline.clear();
if (removedVisible && d->itemCount == 0) {
QCOMPARE(name->text(), QString("New"));
// Add some more items so that we don't run out
- for (int i = 50; i < 100; i++)
+ model.clear();
+ for (int i = 0; i < 50; i++)
model.addItem("Item" + QString::number(i), "");
+ // QTBUG-QTBUG-20575
+ listview->setCurrentIndex(0);
+ listview->setContentY(30);
+ model.removeItem(0);
+ QTRY_VERIFY(name = findItem<QSGText>(contentItem, "textName", 0));
+
// QTBUG-19198 move to end and remove all visible items one at a time.
listview->positionViewAtEnd();
for (int i = 0; i < 18; ++i)
QCOMPARE(name->text(), QString("New"));
// Add some more items so that we don't run out
- for (int i = 50; i < 100; i++)
+ model.clear();
+ for (int i = 0; i < 50; i++)
model.addItem("Item" + QString::number(i), "");
+ // QTBUG-QTBUG-20575
+ listview->setCurrentIndex(0);
+ listview->setContentY(30);
+ model.removeItem(0);
+ QTRY_VERIFY(name = findItem<QDeclarative1Text>(contentItem, "textName", 0));
+
// QTBUG-19198 move to end and remove all visible items one at a time.
listview->positionViewAtEnd();
for (int i = 0; i < 18; ++i)