Vista style: Fix pixelized elements after focus/activation

Use a float device pixel ratio in the style animations and default
to the application's device pixel ratio.

Pick-to: 5.15
Task-number: QTBUG-86344
Change-Id: I093bfefc0f544eb488da0993a183f92c9c77a286
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Friedemann Kleint 2020-09-01 14:55:51 +02:00
parent 1fd5a970f0
commit 85cdc8ebc1

View File

@ -104,7 +104,8 @@ bool canAnimate(const QStyleOption *option) {
static inline QImage createAnimationBuffer(const QStyleOption *option, const QWidget *widget)
{
const int devicePixelRatio = widget ? widget->devicePixelRatio() : 1;
const qreal devicePixelRatio = widget
? widget->devicePixelRatioF() : qApp->devicePixelRatio();
QImage result(option->rect.size() * devicePixelRatio, QImage::Format_ARGB32_Premultiplied);
result.setDevicePixelRatio(devicePixelRatio);
result.fill(0);