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>
This commit is contained in:
André de la Rocha 2022-03-31 00:54:45 -03:00
parent aa451b13b0
commit 37b702dc12
2 changed files with 6 additions and 7 deletions

View File

@ -4,12 +4,6 @@ if(NOT QT_FEATURE_accessibility)
return()
endif()
# special case begin
if (WIN32 AND NOT TARGET Qt::WindowsUIAutomationSupport)
return()
endif()
# special case end
#####################################################################
## tst_qaccessibility Test:
#####################################################################

View File

@ -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();