qt5base-lts/tests/auto/gui
Volker Hilsheimer 4cca8ee527 QGuiApplication: use translation-based layout direction unless explicitly set
The stored layout direction used to get changed during initialization
to what was auto-detected based on the translation. Changing the
translation then overwrote that stored value, even if an explicit call
to setLayoutDirection was made by the application.

Calling QGuiApplication::setLayoutDirection(Auto) has so far been a
no-op.

Change this logic so that the stored layout direction continues to be
LayoutDirectionAuto also if it's set based on auto-detection, and only
overwrite it when explicitly called with a non-Auto value. This way,
applications can set a layout direction that stays unchanged even when
translators are installed.

Add test coverage that uses a QTranslator.

In practice, this is not a change of behavior, unless applications called
setLayoutDirection(Auto) (which is no longer a no-op), or called
setLayoutDirection() and then installed a translator and expected the
translator's layout direction to come into effect in spite of the explicit
setting.

[ChangeLog][Gui][QGuiApplication] Calling setLayoutDirection with a non-
auto value now disables the auto-detection based on installed
translators. Applications that explicitly set a layout direction and also
want translators installed afterwards to take effect should reset the
layout direction to Auto, which is now no longer a no-op.

Fixes: QTBUG-100632
Pick-to: 6.3
Change-Id: I1fdcebd43a9b1b468ff95bf15f53f441bb214e08
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-24 19:46:01 +01:00
..
image Check if platform has enough RAM for hugeQImage test 2022-02-17 22:00:37 +02:00
itemmodels Fix flags in QFileSystemModel 2022-02-02 10:28:13 +01:00
kernel QGuiApplication: use translation-based layout direction unless explicitly set 2022-02-24 19:46:01 +01:00
math3d QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases 2022-01-16 01:12:15 +01:00
painting Cleanup tests that add test data to resources explicitly 2022-02-11 21:54:44 +01:00
platform tests: skip tst_QX11Info on Wayland 2022-02-17 00:34:50 +01:00
qopengl Block flaky rhi and OpenGL tests on Android 2021-05-30 23:02:53 +02:00
qopenglconfig Remove the qmake project files 2021-01-07 15:32:28 +01:00
qvulkan vulkan: Update legacy tests and examples to the modern validation layer 2021-05-31 17:16:49 +02:00
rhi CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00
text Activate tst_qtextdocument for Android 2022-02-24 14:34:33 +01:00
util QDesktopServices: deprecate destroying URL handlers w/o explicit unsetUrlHandler() 2022-02-15 12:20:16 +00:00
CMakeLists.txt Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00