qt5base-lts/tests/auto/gui/kernel/qguiapplication
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
..
icons
BLACKLIST Blacklist quitOnLastWindowClosedWithEventLoopLocker on B2Qt 2022-01-06 17:11:48 +01:00
CMakeLists.txt Set version for tst_qguiapplication and tst_qcoreapplication 2022-02-17 15:51:29 +01:00
Info.plist CMake: Fix failing tests on macOS developer builds 2020-09-22 19:08:53 +02:00
testplugin.json
tst_qguiapplication.cpp QGuiApplication: use translation-based layout direction unless explicitly set 2022-02-24 19:46:01 +01:00