diff options
| author | Inho Lee <inho.lee@qt.io> | 2023-09-28 13:42:57 +0200 |
|---|---|---|
| committer | Inho Lee <inho.lee@qt.io> | 2024-07-05 06:54:26 +0200 |
| commit | c844a7a5429e74d7cefb9774f288dbaa76fc2bbb (patch) | |
| tree | bd69ed99324654cd46bec7fe12a471de11f8ba49 /src/plugins/platforms/wasm/qwasmintegration.cpp | |
| parent | 385c9397712b771e0f2c3f0a6322f0f624f09a8a (diff) | |
wasm: Revamp QWasmInputContext
1. Use QWasmInputContext by default
2. Use QInputMethodEvent instead of KeyEvent
Todo:
1. Platform dependent preedit control
especially when cursor moved with preedit.
(Tested on Android, Linux, Windows)
(Firefox still has a problem but it's not clear
why PointerEvent doesn't happen.)
2. Apply existing text to inputMethodQueries.
3. Test on touchscreen devices.
4. Test on IOS devices.
5. When dragging selection, freezing
6. Support context menu
Fixes: QTBUG-107139
Fixes: QTBUG-124932
Fixes: QTBUG-117096
Pick-to: 6.7 6.8
Change-Id: Iceb6af3489b3d1195ad58cf8f3deb91275fd1bf4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.cpp')
| -rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index f5cc3e2eee6..e4373749d82 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -157,8 +157,6 @@ QWasmIntegration::~QWasmIntegration() delete m_fontDb; delete m_desktopServices; - if (m_platformInputContext) - delete m_platformInputContext; #if QT_CONFIG(accessibility) delete m_accessibility; #endif @@ -226,13 +224,13 @@ QPlatformOpenGLContext *QWasmIntegration::createPlatformOpenGLContext(QOpenGLCon void QWasmIntegration::initialize() { auto icStrs = QPlatformInputContextFactory::requested(); - if (icStrs.isEmpty() && touchPoints < 1) - return; - - if (!icStrs.isEmpty()) + if (!icStrs.isEmpty()) { m_inputContext.reset(QPlatformInputContextFactory::create(icStrs)); - else + m_wasmInputContext = nullptr; + } else { m_inputContext.reset(new QWasmInputContext()); + m_wasmInputContext = static_cast<QWasmInputContext *>(m_inputContext.data()); + } } QPlatformInputContext *QWasmIntegration::inputContext() const |
