summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-25 11:21:15 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-25 12:53:59 +0200
commit0ed83bab15088e872ee8e4ee52d14dc387639d15 (patch)
treef64eb59ffbab1d66bd72e4068fde94e99acae893 /src/shared
parent5c86789c7e4ea7989384bc386cae28ee4348761e (diff)
downloadqttools-0ed83bab15088e872ee8e4ee52d14dc387639d15.tar.gz
Fix compile warnings from deprecated QBitmap conversion
Simplify code a bit at the same time. Change-Id: If09cf8dcb742e814408ee4145c43636d7f8d6142 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/deviceskin/deviceskin.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/shared/deviceskin/deviceskin.cpp b/src/shared/deviceskin/deviceskin.cpp
index 6a0e6c9df..3d936cccd 100644
--- a/src/shared/deviceskin/deviceskin.cpp
+++ b/src/shared/deviceskin/deviceskin.cpp
@@ -784,15 +784,9 @@ CursorWindow::CursorWindow(const QImage &img, QPoint hot, QWidget* sk)
QPixmap p;
p = QPixmap::fromImage(img);
if (!p.mask()) {
- if (img.hasAlphaChannel()) {
- QBitmap bm;
- bm = QPixmap::fromImage(img.createAlphaMask());
- p.setMask(bm);
- } else {
- QBitmap bm;
- bm = QPixmap::fromImage(img.createHeuristicMask());
- p.setMask(bm);
- }
+ QBitmap bm = img.hasAlphaChannel() ? QBitmap::fromImage(img.createAlphaMask())
+ : QBitmap::fromImage(img.createHeuristicMask());
+ p.setMask(bm);
}
QPalette palette;
palette.setBrush(backgroundRole(), QBrush(p));