summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-08-27 20:09:12 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-08-28 16:10:43 +0000
commitd18444fbfffbb01a9eb2d84454e55c231fe0a36f (patch)
treeee8ea0bbba769c9f7192b793fac82158d5bd6664
parent28702cb239b0dbc915ee3511768ff8e366e35e88 (diff)
Handle device pixel ratio in QHeaderView::setupSectionIndicator
The device pixel ratio was not applied to the section indicator pixmap which made it look blurry on HighDPI screens. Task-number: QTBUG-70084 Change-Id: I8b07b2ffc51781c2d2d89484b8618173f0692fe4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/widgets/itemviews/qheaderview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 70f8b28299..6857ccd8bb 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3369,7 +3369,9 @@ void QHeaderViewPrivate::setupSectionIndicator(int section, int position)
sectionIndicator->resize(w, h);
#endif
- QPixmap pm(w, h);
+ const qreal pixmapDevicePixelRatio = q->devicePixelRatioF();
+ QPixmap pm(QSize(w, h) * pixmapDevicePixelRatio);
+ pm.setDevicePixelRatio(pixmapDevicePixelRatio);
pm.fill(QColor(0, 0, 0, 45));
QRect rect(0, 0, w, h);