┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private/kpixmapmodifier.cpp
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <[email protected]>2020-09-25 16:33:25 +0200
committerElvis Angelaccio <[email protected]>2020-11-01 22:17:17 +0000
commit891ebf5758cd3569974c87f3c25f0546fe2613be (patch)
tree9ee801fb928cfccb0443143fff598e42e855e9c0 /src/kitemviews/private/kpixmapmodifier.cpp
parentadfca907309e89c8a3f294877923fb496b4938e0 (diff)
Fix warnings about scaling pixmaps
Diffstat (limited to 'src/kitemviews/private/kpixmapmodifier.cpp')
-rw-r--r--src/kitemviews/private/kpixmapmodifier.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kitemviews/private/kpixmapmodifier.cpp b/src/kitemviews/private/kpixmapmodifier.cpp
index 5bcb3b8f5..9f7f2edc8 100644
--- a/src/kitemviews/private/kpixmapmodifier.cpp
+++ b/src/kitemviews/private/kpixmapmodifier.cpp
@@ -298,7 +298,7 @@ namespace {
void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
{
- if (scaledSize.isEmpty()) {
+ if (scaledSize.isEmpty() || pixmap.isNull()) {
pixmap = QPixmap();
return;
}
@@ -309,6 +309,12 @@ void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
void KPixmapModifier::applyFrame(QPixmap& icon, const QSize& scaledSize)
{
+ if (icon.isNull()) {
+ icon = QPixmap(scaledSize);
+ icon.fill(Qt::transparent);
+ return;
+ }
+
static TileSet tileSet;
qreal dpr = qApp->devicePixelRatio();