diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2022-06-28 09:32:09 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2022-07-12 13:24:56 +0200 |
commit | c78ec505293ed576779c0ee7342746cde39281d6 (patch) | |
tree | d10db3317a6cfbbd63e7f4d8f2e315050cf10c3c /src/widgets/kernel/qwidget.cpp | |
parent | 9e453dacc3855bafd3d7b692d76699c3bf07b9c6 (diff) |
Improve widget painting under dpr>1 by enabling smooth pixmap scaling
Smooth scaling of icons etc. give far better visual results,
particularly with fractional dpr scaling. So enable this generally in
QStylePainter, and make more of the relevant widgets use QStylePainter
instead of QPainter directly.
Differences can be seen in the widgets examples, e.g. textedit,
gallery, stylesheet (Pagefold), mdi.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-96223
Fixes: QTBUG-101058
Change-Id: I3c34a455d097e5f6a6a09d3b020528b4fbda4d85
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f0da19f9c8..ab129b73e7 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5529,6 +5529,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP && !q->testAttribute(Qt::WA_OpaquePaintEvent) && !q->testAttribute(Qt::WA_NoSystemBackground)) { beginBackingStorePainting(); QPainter p(q); + p.setRenderHint(QPainter::SmoothPixmapTransform); paintBackground(&p, toBePainted, (asRoot || onScreen) ? (flags | DrawAsRoot) : DrawWidgetFlags()); endBackingStorePainting(); } |