- bool startMovingAnim = m_itemSize.isEmpty() || widget->size() != itemBounds.size();
- if (!startMovingAnim) {
- // When having a grid the moving-animation should only be started, if it is done within
- // one row in the vertical scroll-orientation or one column in the horizontal scroll-orientation.
- // Otherwise instead of a moving-animation a create-animation on the new position will be used
- // instead. This is done to prevent overlapping (and confusing) moving-animations.
- const QSizeF itemMargin = m_layouter->itemMargin();
- const qreal xMax = m_itemSize.width() + itemMargin.width();
- const qreal yMax = m_itemSize.height() + itemMargin.height();
- qreal xDiff = qAbs(oldPos.x() - newPos.x());
- qreal yDiff = qAbs(oldPos.y() - newPos.y());
+ bool startMovingAnim = false;
+
+ // When having a grid the moving-animation should only be started, if it is done within
+ // one row in the vertical scroll-orientation or one column in the horizontal scroll-orientation.
+ // Otherwise instead of a moving-animation a create-animation on the new position will be used
+ // instead. This is done to prevent overlapping (and confusing) moving-animations.
+ const int index = widget->index();
+ const Cell cell = m_visibleCells.value(index);
+ if (cell.column >= 0 && cell.row >= 0) {