From bd3928f8ca140a8831c444e6ac713ab68d4ac0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20O=2E=20Cordero=20P=C3=A9rez?= Date: Sun, 14 Jan 2024 23:40:24 -0400 Subject: [PATCH] Shrink unsuported renderer overlay so test can access valid image data quickinspectortext was failing on windows because the overlay that states "DirectX is not supported yet, please use OpenGL or Software backend" dims color values, making color compare fail. A solution for this is to make this overlay a little smaller, so we can get a glimpse of the original colors from the corners we pick colors from in this test. --- plugins/quickinspector/quickscreengrabber.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/quickinspector/quickscreengrabber.cpp b/plugins/quickinspector/quickscreengrabber.cpp index b704190e87..f476fa70e1 100644 --- a/plugins/quickinspector/quickscreengrabber.cpp +++ b/plugins/quickinspector/quickscreengrabber.cpp @@ -819,14 +819,15 @@ void UnsupportedScreenGrabber::requestGrabWindow(const QRectF & /*userViewport*/ p.setRenderHint(QPainter::TextAntialiasing); QColor gray(Qt::black); gray.setAlpha(alpha); - p.fillRect(QRect(QPoint {}, m_window->size()), gray); + auto textBoxRect = QRect(QPoint(4, 4), m_window->size() - QSize(8, 8)); + p.fillRect(textBoxRect, gray); p.setPen(Qt::white); auto font = qApp->font(); font.setPointSize(font.pointSize() + 1); p.setFont(font); QString backend = VariantHandler::displayString(QVariant::fromValue(m_window->graphicsApi())); QString txt = backend + QStringLiteral(" is not supported yet, please use OpenGL or Software backend"); - p.drawText(QRect { QPoint(0, 0), m_window->size() }, Qt::AlignCenter | Qt::TextWordWrap, txt); + p.drawText(textBoxRect, Qt::AlignCenter | Qt::TextWordWrap, txt); emit sceneGrabbed(m_grabbedFrame); }