summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorn Potter <[email protected]>2025-06-18 11:22:54 +1000
committerLorn Potter <[email protected]>2025-06-26 17:24:53 +1000
commit91fe5b358e211aa308effacb95ea2dc1d75590b0 (patch)
tree88740e24ae61eb4cc8b203d78e2dbbe102fd477e
parent5a567e3ed2a0181d88b2f22b844852a23222a168 (diff)
wasm: change input element type to password for password echo modeHEADdev
Fixes: QTBUG-133631 Pick-to: 6.9 6.10 Change-Id: I930de385a24229a7e47f8f80eb607fc59be19d30 Reviewed-by: Morten Johan Sørvig <[email protected]>
-rw-r--r--src/plugins/platforms/wasm/qwasminputcontext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasminputcontext.cpp b/src/plugins/platforms/wasm/qwasminputcontext.cpp
index 27641195cae..2df7066b8e2 100644
--- a/src/plugins/platforms/wasm/qwasminputcontext.cpp
+++ b/src/plugins/platforms/wasm/qwasminputcontext.cpp
@@ -383,6 +383,16 @@ void QWasmInputContext::setFocusObject(QObject *object)
{
qCDebug(qLcQpaWasmInputContext) << Q_FUNC_INFO << object << inputMethodAccepted();
+ QInputMethodQueryEvent query(Qt::InputMethodQueries(Qt::ImEnabled | Qt::ImHints));
+ QCoreApplication::sendEvent(object, &query);
+ if (query.value(Qt::ImEnabled).toBool()
+ && Qt::InputMethodHints(query.value(Qt::ImHints).toInt()).testFlag(Qt::ImhHiddenText)) {
+ m_inputElement.set("type", "password");
+ } else {
+ if (m_inputElement["type"].as<std::string>() != std::string("text"))
+ m_inputElement.set("type", "text");
+ }
+
// Commit the previous composition before change m_focusObject
if (m_focusObject && !m_preeditString.isEmpty())
commitPreeditAndClear();