diff options
author | André de la Rocha <andre.rocha@qt.io> | 2022-03-31 00:54:45 -0300 |
---|---|---|
committer | André de la Rocha <andre.rocha@qt.io> | 2022-03-31 09:04:08 -0300 |
commit | 37b702dc124235e469b4ef0a810f3ddeaa33565e (patch) | |
tree | 00478ed18ab7a3aa3f7a9deaa3e931f135edc94f /tests/auto/other/qaccessibility/tst_qaccessibility.cpp | |
parent | aa451b13b0914e3c33a4e05e792aa8c5effa7a3a (diff) |
Windows: Fix accessibility tests
Accessibility tests were not being built on Windows as they were
depending on a WindowsUIAutomationSupport internal module that no
longer exists, as the UI Automation support classes are now in QtGui.
The patch also fixes a test that was calculating widget geometry
incorrectly on high DPI screens.
Pick-to: 6.2 6.3
Change-Id: Iefed0f6d147853484dfab4b16838b9088fd32dcf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index a593a91525..95223057a0 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -3867,7 +3867,12 @@ void tst_QAccessibility::bridgeTest() RECT rect; hr = buttonElement->get_CurrentBoundingRectangle(&rect); QVERIFY(SUCCEEDED(hr)); - QCOMPARE(buttonRect, QRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top)); + const QRect boundingRect(rect.left, rect.top, rect.right - rect.left + 1, rect.bottom - rect.top + 1); + const QRectF nativeRect = QHighDpi::toNativePixels(QRectF(buttonRect), window.windowHandle()); + const QRect truncRect(int(nativeRect.left()), int(nativeRect.top()), + int(nativeRect.right()) - int(nativeRect.left()) + 1, + int(nativeRect.bottom()) - int(nativeRect.top()) + 1); + QCOMPARE(truncRect, boundingRect); buttonElement->Release(); |