wasm: build with -no-feature-accessibility
Add #ifdefs around the accessibility implementation. Fixes: QTBUG-111509 Pick-to: 6.5 Change-Id: I9a600781b4bf9545f046efa75f962cc40fe196a6 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This commit is contained in:
parent
b6d04c8a82
commit
3c23d701a7
@ -5,10 +5,13 @@
|
||||
#include "qwasmscreen.h"
|
||||
#include "qwasmwindow.h"
|
||||
#include "qwasmintegration.h"
|
||||
#include <QtGui/private/qaccessiblebridgeutils_p.h>
|
||||
|
||||
#include <QtGui/qwindow.h>
|
||||
|
||||
#if QT_CONFIG(accessibility)
|
||||
|
||||
#include <QtGui/private/qaccessiblebridgeutils_p.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility")
|
||||
|
||||
// Qt WebAssembly a11y backend
|
||||
@ -729,3 +732,5 @@ void QWasmAccessibility::onHtmlEventReceived(emscripten::val event)
|
||||
EMSCRIPTEN_BINDINGS(qtButtonEvent) {
|
||||
function("qtEventReceived", &QWasmAccessibility::onHtmlEventReceived);
|
||||
}
|
||||
|
||||
#endif // QT_CONFIG(accessibility)
|
||||
|
@ -4,6 +4,8 @@
|
||||
#ifndef QWASMACCESIBILITY_H
|
||||
#define QWASMACCESIBILITY_H
|
||||
|
||||
#if QT_CONFIG(accessibility)
|
||||
|
||||
#include <QtCore/qhash.h>
|
||||
#include <private/qstdweb_p.h>
|
||||
#include <qpa/qplatformaccessibility.h>
|
||||
@ -81,4 +83,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // QT_CONFIG(accessibility)
|
||||
|
||||
#endif
|
||||
|
@ -76,10 +76,12 @@ EMSCRIPTEN_BINDINGS(qtQWasmIntegraton)
|
||||
QWasmIntegration *QWasmIntegration::s_instance;
|
||||
|
||||
QWasmIntegration::QWasmIntegration()
|
||||
: m_fontDb(nullptr),
|
||||
m_desktopServices(nullptr),
|
||||
m_clipboard(new QWasmClipboard),
|
||||
m_accessibility(new QWasmAccessibility)
|
||||
: m_fontDb(nullptr)
|
||||
, m_desktopServices(nullptr)
|
||||
, m_clipboard(new QWasmClipboard)
|
||||
#if QT_CONFIG(accessibility)
|
||||
, m_accessibility(new QWasmAccessibility)
|
||||
#endif
|
||||
{
|
||||
s_instance = this;
|
||||
|
||||
@ -142,7 +144,9 @@ QWasmIntegration::~QWasmIntegration()
|
||||
delete m_desktopServices;
|
||||
if (m_platformInputContext)
|
||||
delete m_platformInputContext;
|
||||
#if QT_CONFIG(accessibility)
|
||||
delete m_accessibility;
|
||||
#endif
|
||||
|
||||
for (const auto &elementAndScreen : m_screens)
|
||||
elementAndScreen.second->deleteScreen();
|
||||
|
@ -134,7 +134,9 @@ QWasmWindow::~QWasmWindow()
|
||||
m_compositor->removeWindow(this);
|
||||
if (m_requestAnimationFrameId > -1)
|
||||
emscripten_cancel_animation_frame(m_requestAnimationFrameId);
|
||||
#if QT_CONFIG(accessibility)
|
||||
QWasmAccessibility::removeAccessibilityEnableButton(window());
|
||||
#endif
|
||||
}
|
||||
|
||||
void QWasmWindow::onRestoreClicked()
|
||||
@ -212,10 +214,12 @@ void QWasmWindow::initialize()
|
||||
m_normalGeometry = rect;
|
||||
QPlatformWindow::setGeometry(m_normalGeometry);
|
||||
|
||||
#if QT_CONFIG(accessibility)
|
||||
// Add accessibility-enable button. The user can activate this
|
||||
// button to opt-in to accessibility.
|
||||
if (window()->isTopLevel())
|
||||
QWasmAccessibility::addAccessibilityEnableButton(window());
|
||||
#endif
|
||||
}
|
||||
|
||||
QWasmScreen *QWasmWindow::platformScreen() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user