diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2017-05-03 12:34:20 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2017-05-03 10:39:30 +0000 |
commit | ea381fba363fcf9b9ef463f24eb90c5e5517fd01 (patch) | |
tree | 5de6345215d606032767d248d6b061df819b85e2 /src/quickcontrols2/qquickiconimage.cpp | |
parent | 32977882a289d351fe99270d8b6adca49616fe39 (diff) |
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 <jpnurmi@qt.io>
Diffstat (limited to 'src/quickcontrols2/qquickiconimage.cpp')
-rw-r--r-- | src/quickcontrols2/qquickiconimage.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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 |