summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2024-06-30 17:56:10 +0200
committerChristian Ehrlicher <[email protected]>2024-07-01 22:50:42 +0200
commitdb328ca975bc63f3baf3d021dcff1ea37fa6b6a0 (patch)
treefcd7e0010d75b76d0e042c5332a78acee1996853 /src
parentd3be87ff1d558f05309b1f29f7e71f291498584f (diff)
QPA/Windows: Avoid confusing warning about empty QPixmap
A drag'n'drop operation on a screen with a dpr != 1 tries to scale the (optional) QDrag pixmap. This results in a confusing warning "QPixmap::scaleWidth: Pixmap is a null pixmap". Avoid it by checking if there is a pixmap available before trying to scale it. Fixes: QTBUG-122755 Pick-to: 6.8 6.5 Change-Id: I554675b79840e34ddd3f53153b68e913fd333122 Reviewed-by: Oliver Wolff <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index b872ef2ad69..c9e7ae90a9e 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -272,7 +272,7 @@ void QWindowsOleDropSource::createCursors()
hotSpotScaleFactor = QHighDpiScaling::factor(platformScreen);
pixmapScaleFactor = hotSpotScaleFactor / pixmap.devicePixelRatio();
}
- QPixmap scaledPixmap = qFuzzyCompare(pixmapScaleFactor, 1.0)
+ QPixmap scaledPixmap = (hasPixmap && qFuzzyCompare(pixmapScaleFactor, 1.0))
? pixmap
: pixmap.scaled((QSizeF(pixmap.size()) * pixmapScaleFactor).toSize(),
Qt::KeepAspectRatio, Qt::SmoothTransformation);