wasm: port rest of input context event handlers
Follow-up to 13e92283, change the clipboard event handlers to use QWasmEventHandler as well. The removed addEventListener calls set capturing to false, but this is already the default (also for QWasmEventHandler), Change-Id: Ibecaa22099fecd371a5d243cf391d3ce6f562400 Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
This commit is contained in:
parent
a4aac362cf
commit
0f5690c5a2
@ -231,13 +231,6 @@ static void pasteCallback(emscripten::val event)
|
|||||||
// propagate to input event (insertFromPaste)
|
// propagate to input event (insertFromPaste)
|
||||||
}
|
}
|
||||||
|
|
||||||
EMSCRIPTEN_BINDINGS(wasminputcontext_module) {
|
|
||||||
|
|
||||||
function("qtCopyCallback", ©Callback);
|
|
||||||
function("qtCutCallback", &cutCallback);
|
|
||||||
function("qtPasteCallback", &pasteCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
QWasmInputContext::QWasmInputContext()
|
QWasmInputContext::QWasmInputContext()
|
||||||
{
|
{
|
||||||
qCDebug(qLcQpaWasmInputContext) << Q_FUNC_INFO;
|
qCDebug(qLcQpaWasmInputContext) << Q_FUNC_INFO;
|
||||||
@ -266,15 +259,9 @@ QWasmInputContext::QWasmInputContext()
|
|||||||
m_compositionUpdateCallback = QWasmEventHandler(m_inputElement, "compositionupdate", QWasmInputContext::compositionUpdateCallback);
|
m_compositionUpdateCallback = QWasmEventHandler(m_inputElement, "compositionupdate", QWasmInputContext::compositionUpdateCallback);
|
||||||
|
|
||||||
// Clipboard for InputContext
|
// Clipboard for InputContext
|
||||||
m_inputElement.call<void>("addEventListener", std::string("cut"),
|
m_clipboardCut = QWasmEventHandler(m_inputElement, "cut", cutCallback);
|
||||||
emscripten::val::module_property("qtCutCallback"),
|
m_clipboardCopy = QWasmEventHandler(m_inputElement, "copy", copyCallback);
|
||||||
emscripten::val(false));
|
m_clipboardPaste = QWasmEventHandler(m_inputElement, "paste", pasteCallback);
|
||||||
m_inputElement.call<void>("addEventListener", std::string("copy"),
|
|
||||||
emscripten::val::module_property("qtCopyCallback"),
|
|
||||||
emscripten::val(false));
|
|
||||||
m_inputElement.call<void>("addEventListener", std::string("paste"),
|
|
||||||
emscripten::val::module_property("qtPasteCallback"),
|
|
||||||
emscripten::val(false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWasmInputContext::~QWasmInputContext()
|
QWasmInputContext::~QWasmInputContext()
|
||||||
|
@ -55,6 +55,10 @@ private:
|
|||||||
void updateInputElement();
|
void updateInputElement();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QWasmEventHandler m_clipboardCut;
|
||||||
|
QWasmEventHandler m_clipboardCopy;
|
||||||
|
QWasmEventHandler m_clipboardPaste;
|
||||||
|
|
||||||
QString m_preeditString;
|
QString m_preeditString;
|
||||||
int m_replaceSize = 0;
|
int m_replaceSize = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user