diff --git a/plugins/quickinspector/quickscreengrabber.cpp b/plugins/quickinspector/quickscreengrabber.cpp index 7c80224cb..3e9ad6024 100644 --- a/plugins/quickinspector/quickscreengrabber.cpp +++ b/plugins/quickinspector/quickscreengrabber.cpp @@ -821,7 +821,14 @@ UnsupportedScreenGrabber::~UnsupportedScreenGrabber() void UnsupportedScreenGrabber::requestGrabWindow(const QRectF & /*userViewport*/) { + const qreal ratio = m_window->effectiveDevicePixelRatio(); + const int width = m_window->width(), + height = m_window->height(); m_grabbedFrame.image = m_window->grabWindow(); + if (ratio == 1.0) + m_grabbedFrame.image = m_grabbedFrame.image.copy(0, 0, width, height); + else + m_grabbedFrame.image = m_grabbedFrame.image.copy(0, 0, width, height).scaledToHeight(height * ratio); int alpha = 120; if (m_grabbedFrame.image.isNull()) { @@ -830,8 +837,6 @@ void UnsupportedScreenGrabber::requestGrabWindow(const QRectF & /*userViewport*/ alpha = 200; } - m_grabbedFrame.image.setDevicePixelRatio(m_window->effectiveDevicePixelRatio()); - QPainter p(&m_grabbedFrame.image); p.setRenderHint(QPainter::TextAntialiasing); QColor gray(Qt::black);