fix: restore soft keyboard input support in Qt6 for DLineEdit and DPasswordEdit#761
Merged
Merged
Conversation
There was a problem hiding this comment.
Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
mhduiy
previously approved these changes
Jul 22, 2026
MyLeeJiEun
approved these changes
Jul 22, 2026
DPasswordEdit The previous workaround for Qt6's ImEnabled behavior change (Qt::WA_InputMethodEnabled not being respected) was too aggressive - it blocked all input method events including those from soft keyboards, which rely on InputMethod events for character input. This commit replaces the broad event filter approach with a targeted override of inputMethodQuery() in a custom DLineEditImpl class that correctly checks the WA_InputMethodEnabled attribute. The password edit's event filter for InputMethod events is removed since the base fix handles both cases. Log: Fixed soft keyboard input being disabled in Qt6 for DLineEdit and DPasswordEdit Influence: 1. Test soft keyboard input (e.g., on-screen keyboard or touch keyboard) works in DLineEdit 2. Test soft keyboard input works in DPasswordEdit 3. Verify that IME (Input Method Editor) can still be disabled via WA_InputMethodEnabled attribute 4. Test normal keyboard input still functions correctly in both widgets 5. Verify that input method popup windows (e.g., text prediction) can be disabled independently 6. Test in Qt6 environment specifically - ensure no regression for Qt5 fix: 在 Qt6 中恢复 DLineEdit 和 DPasswordEdit 的软键盘输入支持 之前的 Qt6 临时解决方案因过度拦截输入法事件导致软键盘输入被禁用。现通 过自定义 DLineEditImpl 类正确重写 inputMethodQuery() 方法替代全量事件过 滤,密码输入框也移除了相应的输入法事件拦截代码。 Log: 修复 DLineEdit 和 DPasswordEdit 在 Qt6 下软键盘输入被禁用的问题 Influence: 1. 测试 DLineEdit 中软键盘输入功能正常 2. 测试 DPasswordEdit 中软键盘输入功能正常 3. 验证通过 WA_InputMethodEnabled 属性仍可禁用输入法 4. 测试两个组件的普通键盘输入功能正常 5. 验证输入法弹窗(如文字预测)可独立禁用 6. 特别在 Qt6 环境下测试,确保 Qt5 无回归 PMS: BUG-371067
mhduiy
approved these changes
Jul 22, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy, MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous workaround for Qt6's ImEnabled behavior change
(Qt::WA_InputMethodEnabled not being respected) was too aggressive -
it blocked all input method events including those from soft keyboards,
which rely on InputMethod events for character input. This commit
replaces the broad event filter approach with a targeted override of
inputMethodQuery() in a custom DLineEditImpl class that correctly checks
the WA_InputMethodEnabled attribute. The password edit's event filter
for InputMethod events is removed since the base fix handles both cases.
Log: Fixed soft keyboard input being disabled in Qt6 for DLineEdit and
DPasswordEdit
Influence:
works in DLineEdit
WA_InputMethodEnabled attribute
disabled independently
fix: 在 Qt6 中恢复 DLineEdit 和 DPasswordEdit 的软键盘输入支持
之前的 Qt6 临时解决方案因过度拦截输入法事件导致软键盘输入被禁用。现通
过自定义 DLineEditImpl 类正确重写 inputMethodQuery() 方法替代全量事件过
滤,密码输入框也移除了相应的输入法事件拦截代码。
Log: 修复 DLineEdit 和 DPasswordEdit 在 Qt6 下软键盘输入被禁用的问题
Influence:
PMS: BUG-371067