From ea381fba363fcf9b9ef463f24eb90c5e5517fd01 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 3 May 2017 12:34:20 +0200 Subject: QQuickIconImage: use QQuickPixmap::width/height instead of implicitSize QQuickPixmap's implicitSize is the original size of the image on disk before any scaling was done on it, which means that it doesn't account for the scaling that QQuickImageProviderWithOptions::loadSize() does. This was causing updateFillMode() to alternate between setting PreserveAspectFit and Pad when the icon color was changed. I was not able to come up with an auto test that reproduced the issue. Task-number: QTBUG-60528 Change-Id: I1cc31f0c50875d794c37a6fc76ff0942e44d271a Reviewed-by: J-P Nurmi --- src/quickcontrols2/qquickiconimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quickcontrols2/qquickiconimage.cpp') diff --git a/src/quickcontrols2/qquickiconimage.cpp b/src/quickcontrols2/qquickiconimage.cpp index 629fc0cb..c628c7ae 100644 --- a/src/quickcontrols2/qquickiconimage.cpp +++ b/src/quickcontrols2/qquickiconimage.cpp @@ -107,7 +107,7 @@ void QQuickIconImagePrivate::updateFillMode() updatingFillMode = true; - const QSize pixmapSize = pix.implicitSize() / calculateDevicePixelRatio(); + const QSize pixmapSize = QSize(pix.width(), pix.height()) / calculateDevicePixelRatio(); if (pixmapSize.width() > q->width() || pixmapSize.height() > q->height()) q->setFillMode(QQuickImage::PreserveAspectFit); else -- cgit v1.2.3