Skip to content

fix(qt): IME 预览测量/失焦清理/失败提交 (#155) - #230

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/qt-ime-gaps
Oct 30, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/qt-ime-gaps

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

修 #155 审计中发现的 3 处代码级问题(第 4 条 event->attributes() 暂不处理,见边界):

# 问题 修法
1 preedit 预览用 preedit_.size() 当列宽,宽字符/组合字符会画错 改用 QFontMetricsF::horizontalAdvance(preedit_)
2 失焦/隐藏时不清 preedit,界面会留一段会话从未收到的文字 FocusOut/Hide 时清空并重绘
3 commit 发送失败被忽略 仅当 model_.send() 成功才清空预览;失败时保留,避免「已送出」的假象

验证

build-qt 构建 termforge_qt_shell、qt_cpp_shell_smoke 通过;本地 Qt 冒烟:

{"status": "passed", "exit_code": 0, "arithmetic": 750, "child_exit": 37, "cleanup_verified": true}

边界

  • event->attributes() 仍未读取:Qt 的输入法属性(下划线/选区样式)目前统一按下划线画,属观感差异,未在本 PR 处理;
  • 不改输入语义、不改队列上限。

Refs #155

…d commits refs #155

The preview now uses the font advance instead of the QChar count, losing focus drops the composition, and a commit rejected by the bounded queue keeps its preview visible.
@JavaZeroo
JavaZeroo merged commit cc3ceb3 into main Oct 30, 2026
5 of 6 checks passed
JavaZeroo added a commit that referenced this pull request Oct 31, 2026
#165 的实现已被 #205/#230 取代(main 上已有组合/提交/取消),但两份计划文档在 main 缺失:
qt-ime-integration-plan.md、qt-ime-native-observation-plan.md。
仍为纯新增,不修改 main 已有文件。
JavaZeroo added a commit that referenced this pull request Oct 31, 2026
#165 的实现已被 #205/#230 取代(main 上已有组合/提交/取消),但两份计划文档在 main 缺失:
qt-ime-integration-plan.md、qt-ime-native-observation-plan.md。
仍为纯新增,不修改 main 已有文件。
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.

1 participant