diff options
author | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2011-11-24 15:33:29 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-25 11:29:11 +0100 |
commit | 53e4dfec7be15d63f60da4fddb926579c56a20a5 (patch) | |
tree | 1ae9138ca0d045068f994c97940630b639f01455 /src/plugins | |
parent | 84a9b009e71857192a2e7edbd569393231748b7c (diff) |
Change default implementation of window() to just return 0
Instead move the traversal up to the ancestors to the bridge.
This simplifies the default implementation to just return 0
Change-Id: Ic3ec60851f378587f4a23363aec2039d0e8a08a1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsaccessibility.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp index ee8ecc162e..883398100c 100644 --- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp @@ -1285,13 +1285,28 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accSelection(VARIANT *pvarChil return S_OK; } +static QWindow *window_helper(const QAccessibleInterface *iface) +{ + QWindow *window = iface->window(); + if (!window) { + QAccessibleInterface *acc = iface->parent(); + while (acc && !window) { + window = acc->window(); + QAccessibleInterface *par = acc->parent(); + delete acc; + acc = par; + } + } + return window; +} + HRESULT STDMETHODCALLTYPE QWindowsAccessible::GetWindow(HWND *phwnd) { *phwnd = 0; if (!accessible->isValid()) return E_UNEXPECTED; - QWindow *window = accessible->window(); + QWindow *window = window_helper(accessible); if (!window) return E_FAIL; @@ -1387,7 +1402,7 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QObject *o, int who, QAcce // An event has to be associated with a window, // so find the first parent that is a widget and that has a WId QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o); - QWindow *window = iface->window(); + QWindow *window = window_helper(iface); if (!window) { window = QGuiApplication::activeWindow(); |