diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmaccessibility.cpp | 21 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmaccessibility.h | 1 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/platforms/wasm/qwasmaccessibility.cpp b/src/plugins/platforms/wasm/qwasmaccessibility.cpp index e9217cbefc..bea7380bfc 100644 --- a/src/plugins/platforms/wasm/qwasmaccessibility.cpp +++ b/src/plugins/platforms/wasm/qwasmaccessibility.cpp @@ -113,17 +113,18 @@ emscripten::val QWasmAccessibility::getContainer(QWindow *window) emscripten::val QWasmAccessibility::getContainer(QAccessibleInterface *iface) { - QWindow *window = iface->window(); - if (!window) { - //this is needed to add tabs as the window is not available - if (iface->parent()->window()) { - window = iface->parent()->window(); - } else { - return emscripten::val::undefined(); - } - } + if (!iface) + return emscripten::val::undefined(); + return getContainer(getWindow(iface)); +} - return getContainer(window); +QWindow *QWasmAccessibility::getWindow(QAccessibleInterface *iface) +{ + QWindow *window = iface->window(); + // this is needed to add tabs as the window is not available + if (!window && iface->parent()) + window = iface->parent()->window(); + return window; } emscripten::val QWasmAccessibility::getDocument(const emscripten::val &container) diff --git a/src/plugins/platforms/wasm/qwasmaccessibility.h b/src/plugins/platforms/wasm/qwasmaccessibility.h index 73a32d31b7..dd9770179a 100644 --- a/src/plugins/platforms/wasm/qwasmaccessibility.h +++ b/src/plugins/platforms/wasm/qwasmaccessibility.h @@ -36,6 +36,7 @@ private: static emscripten::val getContainer(QAccessibleInterface *iface); static emscripten::val getDocument(const emscripten::val &container); static emscripten::val getDocument(QAccessibleInterface *iface); + static QWindow *getWindow(QAccessibleInterface *iface); emscripten::val createHtmlElement(QAccessibleInterface *iface); void destroyHtmlElement(QAccessibleInterface *iface); |