From d18444fbfffbb01a9eb2d84454e55c231fe0a36f Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Mon, 27 Aug 2018 20:09:12 +0200 Subject: Handle device pixel ratio in QHeaderView::setupSectionIndicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/widgets/itemviews/qheaderview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets') 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); -- cgit v1.2.3