:wasm Fix not possible to type tab character in TextEdit

qinputcontrol refused to accept the character since
text part of key was empty

This caused the tabkey to always switch focus instead

Fixes: QTBUG-124232
Change-Id: I9ea7f02831cc88479b4e15d25eac278547f6f711
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit e794894ece0bcfc78fa4155cb01d825791ea102b)
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Even Oscar Andersen 2024-03-26 17:41:57 +01:00
parent 980cd76e65
commit 5869e4b024

View File

@ -113,6 +113,9 @@ KeyEvent::KeyEvent(EventType type, emscripten::val event) : Event(type, event)
text = QString::fromUtf8(webKey);
if (text.size() > 1)
text.clear();
if (key == Qt::Key_Tab)
text = "\t";
}
KeyEvent::~KeyEvent() = default;