qt5base-lts/tests/auto/widgets
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
..
dialogs Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
effects Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
graphicsview unblacklist passing tests 2022 2022-06-23 01:36:01 +02:00
itemviews Fix memory leak in tst_qtreewidget 2022-05-18 10:58:05 +00:00
kernel IM: Don't let all widgets support IM by default 2022-07-01 10:47:17 +02:00
styles Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
util Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
widgets QKeySequenceEdit: add a maximumSquenceLength property 2022-06-27 12:02:47 +00:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00