diff options
| author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-09-06 12:56:42 +0200 |
|---|---|---|
| committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-09-09 19:06:40 +0200 |
| commit | adebdd0f9af0ffe47250b4a273407b84a6c61879 (patch) | |
| tree | 23af378f198a56c19d857935ec079e2050f75544 /src/plugins/platforms/wasm/qwasmcompositor.cpp | |
| parent | 124522a0a575f52172de841068d8e949703edb37 (diff) | |
Propagate the copy event correctly to Qt widgets on WASM
The event should be propagated when the native clipboard is available.
A recent regression caused it to be suppressed, which resulted in lack
of copy/paste capabilities.
Pick-to: 6.4 6.4.0
Change-Id: I030a31aa0951c3813ce1d38da9a6526010b3bfc8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmcompositor.cpp')
| -rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index 5ba8688ff10..ccf7bd93562 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -829,13 +829,8 @@ bool QWasmCompositor::processKeyboard(int eventType, const EmscriptenKeyboardEve const QFlags<Qt::KeyboardModifier> modifiers = KeyboardModifier::getForEvent(*emKeyEvent); - // Clipboard path: cut/copy/paste are handled by clipboard event or direct clipboard access. - if (translatedEvent.type == QEvent::KeyPress && modifiers.testFlag(Qt::ControlModifier) - && (translatedEvent.key == Qt::Key_X || translatedEvent.key == Qt::Key_V - || translatedEvent.key == Qt::Key_C)) { - QWasmIntegration::get()->getWasmClipboard()->isPaste = translatedEvent.key == Qt::Key_V; - return false; // continue on to event - } + if (QWasmIntegration::get()->getWasmClipboard()->processKeyboard(translatedEvent, modifiers)) + return false; if (translatedEvent.text.isEmpty()) translatedEvent.text = QString(emKeyEvent->key); |
