From 91bff47d31c339b4825c1abebad5ed335e28b38a Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Tue, 1 Nov 2022 10:44:33 +0100 Subject: [PATCH] Add comment to tst_QWidget::saveRestoreGeometry() for debugging saveRestoreGeometry() somtimes creates a 29px offset when debugged in Qt Creator, which makes the test fail. This patch adds a code comment to make developers aware of this fact. Change-Id: I920bd02eb7543faf8b25a0a242b888f3a3745e2a Reviewed-by: Richard Moe Gustavsen (cherry picked from commit efb74636567d9eff3366e439faf37eea5d6d3668) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 9f0cdb9d2d0..bbec6dbeb49 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4013,6 +4013,13 @@ void tst_QWidget::saveRestoreGeometry() QVERIFY(QTest::qWaitForWindowExposed(&widget)); QApplication::processEvents(); + + /* --------------------------------------------------------------------- + * This test function is likely to flake when debugged with Qt Creator. + * (29px offset making the following QTRY_VERIFY2 fail) + * --------------------------------------------------------------------- + */ + QTRY_VERIFY2(HighDpi::fuzzyCompare(widget.pos(), position, m_fuzz), qPrintable(HighDpi::msgPointMismatch(widget.pos(), position))); QCOMPARE(widget.size(), size);