qt5base-lts/src/gui/kernel
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
..
qaction_p.h Simplify QAction privates 2020-10-06 09:41:31 +02:00
qaction.cpp Add QMenu::menuInAction as a static helper 2021-11-01 23:22:55 +01:00
qaction.h Consistent indentation for all Q_PROPERTYs 2021-06-24 23:06:20 +02:00
qactiongroup_p.h Remove QGuiAction again and split QAction implementation up instead 2020-03-29 11:18:57 +01:00
qactiongroup.cpp Cleanup QAction::visible property 2020-09-10 09:24:18 +00:00
qactiongroup.h Add forwarding headers for classes moved from QtWidgets to QtGui 2020-10-20 19:27:04 +02:00
qclipboard.cpp QClipboard: remove a useless default switch-case label 2021-07-16 12:42:47 +00:00
qclipboard.h
qcursor_p.h
qcursor.cpp Doc: Remove mentioning of Fowler book 2022-01-17 18:11:42 +01:00
qcursor.h Centralize the implementation of move assignment operators 2020-10-03 11:47:17 +02:00
qdnd_p.h Merge remote-tracking branch 'origin/5.13' into 5.14 2019-10-28 10:50:03 +01:00
qdnd.cpp Tidy nullptr usage 2019-12-06 12:13:20 +01:00
qdrag.cpp Doc: Fix documentation warnings for Qt GUI 2020-11-19 12:28:45 +01:00
qdrag.h Remove deprecated members from several QtGui classes 2020-04-27 12:21:29 +02:00
qevent_p.h De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qevent.cpp De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qevent.h Deprecate QContextMenuEvent and QMouseEvent ctors without globalPos 2022-02-05 17:18:35 +01:00
qeventpoint_p.h QMutableEventPoint: turn into memberless struct 2022-01-15 22:02:27 +01:00
qeventpoint.cpp QGuiApplication: port the last user of QMutableEventPoint::from() 2022-01-14 12:32:30 +00:00
qeventpoint.h QEventPoint: forward-declare QMutableEventPoint before befriending it 2022-01-12 02:03:15 +01:00
qgenericplugin.cpp
qgenericplugin.h
qgenericpluginfactory.cpp
qgenericpluginfactory.h
qguiapplication_p.h Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to use 2022-02-22 14:48:38 +01:00
qguiapplication_platform.h Add warning about native interface APIs to platform headers 2022-02-09 14:02:57 +01:00
qguiapplication.cpp QGuiApplication: use translation-based layout direction unless explicitly set 2022-02-24 19:46:01 +01:00
qguiapplication.h Add native interface for X11 application, exposing display and connection 2021-08-06 15:09:39 +02:00
qguivariant.cpp qmetatype: Remove left-over module association code 2022-02-09 14:02:57 +01:00
qhighdpiscaling_p.h Handle WM_GETDPISCALEDSIZE 2021-10-07 14:22:55 +02:00
qhighdpiscaling.cpp QHighDpiScaling: fix typo in doc 2022-01-07 12:25:04 +08:00
qinputdevice_p.h De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qinputdevice.cpp De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qinputdevice.h gui: add QInputDevice::seatNames() 2021-11-28 13:15:00 +02:00
qinputdevicemanager_p_p.h QInputDeviceManager: initialize device counts 2020-01-09 10:45:48 +02:00
qinputdevicemanager_p.h QInputDeviceManager: make QT_NO_KEYWORDS-clean 2021-08-06 16:49:08 +02:00
qinputdevicemanager.cpp QInputDeviceManager: ++explicit, ++out-of-line-dtors 2021-08-06 13:02:44 +02:00
qinputmethod_p.h More nullptr usage in headers 2019-03-14 07:37:52 +00:00
qinputmethod.cpp QInputMethod: check if focusobject supports the "new" IM function before calling it 2021-11-11 21:24:30 +01:00
qinputmethod.h Consistent indentation for all Q_PROPERTYs 2021-06-24 23:06:20 +02:00
qinternalmimedata_p.h Cleanup API of QMimeData 2020-09-21 14:56:09 +02:00
qinternalmimedata.cpp Cleanup API of QMimeData 2020-09-21 14:56:09 +02:00
qkeymapper_p.h Improve error reporting when requesting unsupported native interface 2021-07-15 17:26:26 +02:00
qkeymapper.cpp Use member function instead of template function to resolve native interface 2021-07-17 02:23:17 +02:00
qkeysequence_p.h Long live QKeyCombination! 2020-09-03 07:00:31 +02:00
qkeysequence.cpp gui: Fix typos in source code comments 2021-10-12 12:52:02 +02:00
qkeysequence.h Centralize the implementation of move assignment operators 2020-10-03 11:47:17 +02:00
qoffscreensurface_p.h Add QOffScreenSurface platform API abstraction 2020-08-27 23:35:16 +03:00
qoffscreensurface_platform.h Add warning about native interface APIs to platform headers 2022-02-09 14:02:57 +01:00
qoffscreensurface.cpp gui: Fix typos in documentation 2021-10-12 12:52:02 +02:00
qoffscreensurface.h Improve error reporting when requesting unsupported native interface 2021-07-15 17:26:26 +02:00
qopenglcontext_p.h Another round of 0->nullptr cleanup 2020-07-31 12:56:50 +02:00
qopenglcontext_platform.h Add warning about native interface APIs to platform headers 2022-02-09 14:02:57 +01:00
qopenglcontext.cpp Use member function instead of template function to resolve native interface 2021-07-17 02:23:17 +02:00
qopenglcontext.h QOpenGlContext: remove duplicated include 2021-07-20 15:50:17 +02:00
qpaintdevicewindow_p.h De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qpaintdevicewindow.cpp De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qpaintdevicewindow.h Introduce QWindow::paintEvent with QPA plumbing 2020-08-26 16:44:53 +02:00
qpalette.cpp Don't change resolve mask when setting brush doesn't change palette 2021-12-03 21:07:09 +01:00
qpalette.h Unwrap private QPalette data member 2020-10-14 23:43:38 +02:00
qpixelformat.cpp gui: Fix typos in documentation 2021-10-12 12:52:02 +02:00
qpixelformat.h QPixelFormat: Fix warning about mixing different enums 2020-08-23 02:34:56 +02:00
qplatformclipboard.cpp Tidy nullptr usage 2019-12-06 12:13:20 +01:00
qplatformclipboard.h QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classes 2018-12-13 07:13:26 +00:00
qplatformcursor.cpp Make bytes-per-line safe for int overflow 2020-02-20 16:11:02 +01:00
qplatformcursor.h Move the tooltip out of the way of very large mouse cursors 2019-12-09 17:43:22 +01:00
qplatformdialoghelper.cpp QFileDialog: Use static const QRegularExpression 2021-08-18 08:50:54 +05:00
qplatformdialoghelper.h Fix correspondence between QFileDialog::Option and QFileDialogOption::FileDialogOptions 2021-10-19 20:13:14 +00:00
qplatformdrag.cpp Make sure we can build with -no-feature-draganddrop 2018-05-29 18:31:35 +00:00
qplatformdrag.h QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classes 2018-12-13 07:13:26 +00:00
qplatformgraphicsbuffer.cpp Remove last remaining bits of QtPlatformHeaders 2020-08-04 07:12:32 +02:00
qplatformgraphicsbuffer.h Merge remote-tracking branch 'origin/5.12' into 5.13 2019-03-20 14:09:30 +01:00
qplatformgraphicsbufferhelper.cpp Add ; to Q_UNUSED 2020-07-07 11:51:48 +02:00
qplatformgraphicsbufferhelper.h Move backing store OpenGL support to the platformcompositor module 2020-02-03 22:05:44 +01:00
qplatforminputcontext_p.h
qplatforminputcontext.cpp Make setSelectionOnFocusObject() take native pixels 2021-02-02 10:22:52 +01:00
qplatforminputcontext.h Add geometry accessors to QPlatformInputContext 2021-02-01 20:06:52 +01:00
qplatforminputcontextfactory_p.h
qplatforminputcontextfactory.cpp Tidy nullptr usage 2019-12-06 12:13:20 +01:00
qplatforminputcontextplugin_p.h Replace 0 with nullptr 2018-07-19 15:47:09 +00:00
qplatforminputcontextplugin.cpp
qplatformintegration.cpp Always give Qt::SubWindows a default window state of Qt::WindowNoState 2021-09-10 13:07:27 +00:00
qplatformintegration.h Add a platform capability indicating support for QRhi-based rendering 2021-01-04 17:30:43 +01:00
qplatformintegrationfactory_p.h
qplatformintegrationfactory.cpp QFactoryLoader: add setExtraSearchPath() (for QPA plugins' use) 2022-01-20 15:53:48 -08:00
qplatformintegrationplugin.cpp Add ; to Q_UNUSED 2020-07-07 11:51:48 +02:00
qplatformintegrationplugin.h Replace 0 with nullptr 2018-07-19 15:47:09 +00:00
qplatformmenu_p.h Move QNativeInterface helpers to their own header file 2021-05-10 10:56:56 +02:00
qplatformmenu.cpp
qplatformmenu.h Move private platform interfaces to private QPA headers 2020-07-20 17:47:35 +02:00
qplatformnativeinterface.cpp Add ; to Q_UNUSED 2020-07-07 11:51:48 +02:00
qplatformnativeinterface.h MetaObject: Store the QMetaType of the methods 2020-06-02 22:42:15 +02:00
qplatformoffscreensurface.cpp
qplatformoffscreensurface.h Rejig native interface plumbing 2021-05-12 22:02:05 +02:00
qplatformopenglcontext.cpp Callbacks for begin/end of a frame on OpenGL 2021-12-08 21:08:04 +01:00
qplatformopenglcontext.h Callbacks for begin/end of a frame on OpenGL 2021-12-08 21:08:04 +01:00
qplatformscreen_p.h Expose the native interfaces of QScreen/QWindow 2021-06-07 12:17:46 +00:00
qplatformscreen.cpp Make resizeMaximizedWindows() preserve native geometry 2021-05-11 18:39:07 +02:00
qplatformscreen.h Add QPlatformScreen::colorSpace() 2021-01-25 17:21:54 +01:00
qplatformservices.cpp
qplatformservices.h QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classes 2018-12-13 07:13:26 +00:00
qplatformsessionmanager.cpp Add ; to Q_UNUSED 2020-07-07 11:51:48 +02:00
qplatformsessionmanager.h QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classes 2018-12-13 07:13:26 +00:00
qplatformsharedgraphicscache.cpp Use QList instead of QVector in gui implementation 2020-07-07 20:35:05 +02:00
qplatformsharedgraphicscache.h Use QList instead of QVector in gui 2020-06-29 19:19:47 +02:00
qplatformsurface.cpp Fix scrolling of QRasterBackingStore when operating on QRasterGLSurface 2021-10-01 20:12:15 +02:00
qplatformsurface.h Fix scrolling of QRasterBackingStore when operating on QRasterGLSurface 2021-10-01 20:12:15 +02:00
qplatformsystemtrayicon.cpp
qplatformsystemtrayicon.h MetaObject: Store the QMetaType of the methods 2020-06-02 22:42:15 +02:00
qplatformtheme_p.h QShortcut: Properly port to the new configure system 2019-10-25 12:12:39 +02:00
qplatformtheme.cpp QPA: add ButtonPressKeys ThemeHint 2022-02-16 15:10:00 -05:00
qplatformtheme.h QPA: add ButtonPressKeys ThemeHint 2022-02-16 15:10:00 -05:00
qplatformthemefactory_p.h
qplatformthemefactory.cpp QFactoryLoader: add setExtraSearchPath() (for QPA plugins' use) 2022-01-20 15:53:48 -08:00
qplatformthemeplugin.cpp
qplatformthemeplugin.h Replace 0 with nullptr 2018-07-19 15:47:09 +00:00
qplatformwindow_p.h Expose the native interfaces of QScreen/QWindow 2021-06-07 12:17:46 +00:00
qplatformwindow.cpp QPlatformWindow: fix isAncestorOf not breaking recursion 2021-09-13 19:54:18 +02:00
qplatformwindow.h Move QWINDOWSIZE_MAX to platform headers 2021-09-10 23:13:20 +02:00
qpointingdevice_p.h De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qpointingdevice.cpp De-duplicate vtables, 2022 edition 2022-02-15 09:08:16 +01:00
qpointingdevice.h Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE 2020-11-30 17:16:21 +01:00
qrasterwindow.cpp QtGui: Unify license headers 2019-01-29 10:41:31 +00:00
qrasterwindow.h
qscreen_p.h Remove QScreen::orientationUpdateMask 2020-05-07 13:48:08 +00:00
qscreen.cpp Use member function instead of template function to resolve native interface 2021-07-17 02:23:17 +02:00
qscreen.h Improve error reporting when requesting unsupported native interface 2021-07-15 17:26:26 +02:00
qsessionmanager_p.h Remove excess "virtual" keyword from destructors in Qt Gui 2018-09-25 14:34:42 +00:00
qsessionmanager.cpp Remove "fallback session management" 2020-09-01 10:16:15 +02:00
qsessionmanager.h
qshapedpixmapdndwindow_p.h More nullptr usage in headers 2019-03-14 07:37:52 +00:00
qshapedpixmapdndwindow.cpp Port to QImage and QPixmap deviceIndependentSize() 2021-09-01 15:24:05 +02:00
qshortcut_p.h Add multi key bindings to QShortcut 2020-11-04 10:32:38 +02:00
qshortcut.cpp Add multi key bindings to QShortcut 2020-11-04 10:32:38 +02:00
qshortcut.h Add multi key bindings to QShortcut 2020-11-04 10:32:38 +02:00
qshortcutmap_p.h iOS: Handle keyboard events when using an external keyboard 2021-01-20 12:29:38 +01:00
qshortcutmap.cpp gui: Fix typos in documentation 2021-10-12 12:52:02 +02:00
qsimpledrag_p.h QBasicDrag: Send QDragMoveEvent when modifiers change 2020-05-14 15:19:47 +03:00
qsimpledrag.cpp Change QWindow/QWidget::map(To/From)(Global/Parent) to operate in float 2020-07-14 10:25:47 +02:00
qstylehints.cpp Tidy nullptr usage 2019-12-06 12:13:20 +01:00
qstylehints.h Consistent indentation for all Q_PROPERTYs 2021-06-24 23:06:20 +02:00
qsurface.cpp Update docs for QSurface::MetalSurface to include iOS 2022-02-15 09:11:00 +01:00
qsurface.h Prevent repeated instantiations of some qRegisterNormalizedMetaType<>s [1/N] (QtGui) 2022-01-21 11:22:35 +00:00
qsurfaceformat.cpp Support EGL protected content extension 2021-03-09 11:58:12 +01:00
qsurfaceformat.h Support EGL protected content extension 2021-03-09 11:58:12 +01:00
qt_gui_pch.h Migrate to autogenerated cpp exports 2021-06-24 20:40:49 +02:00
qtestsupport_gui.cpp Don't include qeventpoint_p.h from qevent_p.h 2022-01-14 20:00:54 +00:00
qtestsupport_gui.h Replace Q_REQUIRED_RESULT with [[nodiscard]] 2020-09-25 07:10:45 +02:00
qtguiglobal_p.h
qtguiglobal.h Migrate to autogenerated cpp exports 2021-06-24 20:40:49 +02:00
qwindow_p.h QWindowPrivate: de-inline dtor and ctor 2022-01-20 21:57:45 +00:00
qwindow.cpp QWindowPrivate: de-inline dtor and ctor 2022-01-20 21:57:45 +00:00
qwindow.h Improve error reporting when requesting unsupported native interface 2021-07-15 17:26:26 +02:00
qwindowdefs_win.h Introduce platform API abstraction for QOpenGLContext 2020-07-02 10:27:50 +02:00
qwindowdefs.h Clean up qcontainerfwd.h 2020-11-03 16:28:14 +01:00
qwindowsysteminterface_p.h Allocate synchronously delivered QWSI events on the stack 2021-10-01 06:28:22 +02:00
qwindowsysteminterface.cpp Don't include qeventpoint_p.h from qevent_p.h 2022-01-14 20:00:54 +00:00
qwindowsysteminterface.h Rename QNativeGestureEvent::deltas() to delta(); clarify docs 2021-07-14 17:14:23 +02:00