Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.0 RC2
-
-
6b687ad7ec46fed10766f5d26809c4fe430db608 (qt/qtquickcontrols2/dev)
-
Bug Fixing Candidates
Description
Currently, if we set RTL locale, whole layout changes to RTL,
and there is no way to change the layout back to LTR.
in main.cpp, add following lines to set RTL locale.
QLocale egyptian(QLocale::Arabic, QLocale::Egypt); QLocale::setDefault(egyptian);
and the main.qml looks like below
import QtQuick 2.12 import QtQuick.Window 2.2 import QtQuick.Controls 2.12 Window { visible: true width: 1280 height: 720 title: qsTr("Hello World") ProgressBar { // LayoutMirroring.enabled: false anchors.centerIn: parent indeterminate: true } }
When you run the sampler above, you will find out there is no way to change layout back to LTR.
This is because QQuickControl::isMirrored() checks layout mirroring OR text locale.
If the locale is RTL, isMirrored() always returns true.
https://code.qt.io/cgit/qt/qtquickcontrols2.git/tree/src/quicktemplates2/qquickcontrol.cpp#n1289
bool QQuickControl::isMirrored() const { Q_D(const QQuickControl); return d->isMirrored() || d->locale.textDirection() == Qt::RightToLeft; }
FYI. This could be resolved by reverting https://codereview.qt-project.org/c/qt/qtquickcontrols2/+/143100
Attachments
Issue Links
- relates to
-
QTBUG-87052 When forcing the application layout to be LeftToRight then it will be ignored in an Right To Left locale
- Closed
-
QTBUG-62977 Slider does not work correctly in RTL locales with no mirroring
- Closed