equal
deleted
inserted
replaced
379 QRectF viewRect(itemBoundingRect(mItemView)); |
379 QRectF viewRect(itemBoundingRect(mItemView)); |
380 QSizeF itemsCanvas(q->layout()->preferredSize()); |
380 QSizeF itemsCanvas(q->layout()->preferredSize()); |
381 QPointF pos = q->pos(); |
381 QPointF pos = q->pos(); |
382 qreal itemSize = getScrollDirectionItemSize(); |
382 qreal itemSize = getScrollDirectionItemSize(); |
383 if (Qt::Vertical == mScrollDirection) { |
383 if (Qt::Vertical == mScrollDirection) { |
384 pos.setY(q->pos().y() - itemSize); |
384 pos.setY(pos.y() - itemSize); |
385 if (pos.y() < viewRect.height() - itemsCanvas.height()) { |
385 if (pos.y() < viewRect.height() - itemsCanvas.height()) { |
386 pos.setY(viewRect.height() - itemsCanvas.height()); |
386 pos.setY(viewRect.height() - itemsCanvas.height()); |
387 } |
387 } |
|
388 if (pos.y() > 0) { |
|
389 pos.setY(0); |
|
390 } |
388 } else { |
391 } else { |
389 pos.setX(q->pos().x() - itemSize); |
392 pos.setX(pos.x() - itemSize); |
390 if (pos.x() < viewRect.width() - itemsCanvas.width()) { |
393 if (pos.x() < viewRect.width() - itemsCanvas.width()) { |
391 pos.setX(viewRect.width() - itemsCanvas.width()); |
394 pos.setX(viewRect.width() - itemsCanvas.width()); |
|
395 } |
|
396 if (pos.x() > 0) { |
|
397 pos.setX(0); |
392 } |
398 } |
393 } |
399 } |
394 q->setPos(pos); |
400 q->setPos(pos); |
395 } |
401 } |
396 if (layoutUpdateNeeded) { |
402 if (layoutUpdateNeeded) { |