Commit c0425f39 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Windows Accessibility: Use QWindowsAccessibility::windowHelper().

Amends changes ee516381,
d7a3b614

.

Task-number: QTBUG-52943
Change-Id: Icdf9d99c327bdd38dfb084e6cf77b14cd5ce073b
Reviewed-by: default avatarJan Arve Sæther <jan-arve.saether@theqtcompany.com>
Showing with 4 additions and 11 deletions
......@@ -470,15 +470,6 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::Invoke(long dispIdMember,
return hr;
}
static const QWindow *windowOf(const QAccessibleInterface *ai)
{
for ( ; ai; ai = ai->parent()) {
if (const QWindow *window = ai->window())
return window;
}
return Q_NULLPTR;
}
/*
IAccessible
......@@ -507,7 +498,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accHitTest(long xLeft, long yT
if (!accessible)
return E_FAIL;
const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop), windowOf(accessible));
const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop),
QWindowsAccessibility::windowHelper(accessible));
QAccessibleInterface *child = accessible->childAt(pos.x(), pos.y());
if (child == 0) {
// no child found, return this item if it contains the coordinates
......@@ -550,7 +542,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accLocation(long *pxLeft, long
QAccessibleInterface *acc = childPointer(accessible, varID);
if (!acc || !acc->isValid())
return E_FAIL;
const QRect rect = QHighDpi::toNativePixels(acc->rect(), windowOf(accessible));
const QRect rect = QHighDpi::toNativePixels(acc->rect(),
QWindowsAccessibility::windowHelper(accessible));
*pxLeft = rect.x();
*pyTop = rect.y();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment