Skip to content

fix: restore soft keyboard input support in Qt6 for DLineEdit and DPasswordEdit#761

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
18202781743:master
Jul 22, 2026
Merged

fix: restore soft keyboard input support in Qt6 for DLineEdit and DPasswordEdit#761
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743

Copy link
Copy Markdown
Contributor

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

@18202781743
18202781743 requested review from BLumia and mhduiy July 22, 2026 04:52

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

mhduiy
mhduiy previously 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
@deepin-ci-robot

Copy link
Copy Markdown
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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit 3ddb42a into linuxdeepin:master Jul 22, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants