diff --git a/src/declarativeimports/qtextracomponents/qpixmapitem.cpp b/src/declarativeimports/qtextracomponents/qpixmapitem.cpp index 46d0756cf..fcc66b5c4 100644 --- a/src/declarativeimports/qtextracomponents/qpixmapitem.cpp +++ b/src/declarativeimports/qtextracomponents/qpixmapitem.cpp @@ -114,9 +114,11 @@ void QPixmapItem::paint(QPainter *painter) break; } case PreserveAspectCrop: { - destRect = boundingRect().toRect(); - sourceRect = destRect; - sourceRect.moveCenter(m_pixmap.rect().center()); + QSize scaled = m_pixmap.size(); + + scaled.scale(boundingRect().size().toSize(), Qt::KeepAspectRatioByExpanding); + destRect = QRect(QPoint(0, 0), scaled); + destRect.moveCenter(boundingRect().center().toPoint()); break; } case TileVertically: {