qt5base-lts/tests/auto/widgets/kernel/qwidget
Richard Moe Gustavsen 3b12305575 IM: Don't let all widgets support IM by default
A new property Qt::ImEnabled was added in Qt 5.3.
Since the already existing widgets with IM support
(3rd party included) didn't implement this property,
QWidget got the fall back logic that if a widget
was queried for Qt::ImEnabled, and the returned QVariant
was invalid (the widget didn't implement it), we
would, for backwards compatibility with Qt 4, return "true"
(meaning that the widget supports IM).

But a side effect from this fallback logic, is that now
any widget that doesn't implement ImEnabled (or input
methods at all) report that they support IM. This will
confuse platforms like iOS, which uses ImEnabled to decide
if the input panel should show, and if text selection tools
should be enabled. The result is therefore that if you click
on a QPushButton, the input panel will open.

This patch will implement a more careful strategy to check if
a widget implements IM, if ImEnabled is missing. Rather than
saying that all widgets that don't implement ImEnabled supports
IM, we now require that the widget also returns a valid QVariant
for Qt::ImSurroundingText. We assume then, that a widget that
doesn't do so will anyway not be in need of input method support
from the platform.

Fixes: QTBUG-104527
Pick-to: 6.4 6.3 6.2
Change-Id: Ib391fd1daae92c4325e9ccb59730fbdd7c9328fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-01 10:47:17 +02:00
..
.gitignore Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
BLACKLIST unblacklist passing tests 2022 2022-05-18 23:59:19 +02:00
CMakeLists.txt CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00
geometry-fullscreen.dat Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
geometry-maximized.dat Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
geometry.dat Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
hellotr_la.qm Send the LanguageChange event to all top level windows, not just widgets 2020-02-18 22:11:30 +01:00
tst_qwidget_mac_helpers.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
tst_qwidget_mac_helpers.mm Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
tst_qwidget.cpp IM: Don't let all widgets support IM by default 2022-07-01 10:47:17 +02:00