Skip to content

Commit 469a3f2

Browse files
committed
fix: Handle QLineEdit focus object correctly with QCompleter in Qt6
In Qt6, when using QLineEdit with QCompleter during Chinese input: - qGuiApp->focusObject() and realFocusObject are both QLineEdit - This is logically correct as the focus is indeed on QLineEdit - However, it caused filterEvent to return false and trigger unwanted keypress events - Remove redundant check to ensure proper input method handling Log: Handle QLineEdit focus object correctly with QCompleter in Qt6 Upstream: fcitx/fcitx5-qt#71
1 parent 92aa38e commit 469a3f2

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
fcitx5-qt (5.1.8-2deepin3) unstable; urgency=medium
2+
3+
* Handle QLineEdit focus object correctly with QCompleter in Qt6.
4+
5+
-- Wang Yu <wangyu@uniontch.com> Wed, 18 Jun 2025 10:27:53 +0800
6+
17
fcitx5-qt (5.1.8-2deepin2) unstable; urgency=medium
28

39
* update version for rebuild.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Index: fcitx5-qt-community/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
2+
===================================================================
3+
--- fcitx5-qt-community.orig/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
4+
+++ fcitx5-qt-community/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp
5+
@@ -1249,9 +1249,6 @@ QWindow *QFcitxPlatformInputContext::foc
6+
break;
7+
}
8+
QObject *realFocusObject = focusObjectWrapper();
9+
- if (qGuiApp->focusObject() == realFocusObject) {
10+
- break;
11+
- }
12+
auto *widget = qobject_cast<QWidget *>(realFocusObject);
13+
if (!widget) {
14+
break;

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
0001-Fix-can-t-switch-input-methods-through-the-systray-m.patch
2+
0002-Handle-QLineEdit-focus-object-correctly-with-QCompleter.patch

0 commit comments

Comments
 (0)