From 08ea1e66b8dc701ce49643d193c923c011298a63 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 25 Feb 2013 17:22:41 +0100 Subject: Fix moving widgets in horizontal layouts in RTL mode. Task-number: QTBUG-25872 Change-Id: Ia311b88f0ed3450d798bc5a9136e978c642d5b25 Reviewed-by: Jarek Kobus (cherry picked from qttools/eb456f72052b02a77e22868bfa55a25d7af3e660) --- tools/designer/src/lib/shared/qlayout_widget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/designer/src/lib/shared/qlayout_widget.cpp b/tools/designer/src/lib/shared/qlayout_widget.cpp index 238fca0..e60cf7e 100644 --- a/tools/designer/src/lib/shared/qlayout_widget.cpp +++ b/tools/designer/src/lib/shared/qlayout_widget.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -1388,7 +1389,9 @@ void QLayoutSupport::adjustIndicator(const QPoint &pos, int index) const bool closeToLeft = fromLeftRight == fromLeft; showIndicator(RightIndicator, QRect(closeToLeft ? g.x() : g.right() + 1 - indicatorSize, 0, indicatorSize, r.height()), bluePalette); - const int incr = closeToLeft ? 0 : +1; + const QWidget *parent = layout()->parentWidget(); + const bool leftToRight = Qt::LeftToRight == (parent ? parent->layoutDirection() : QApplication::layoutDirection()); + const int incr = leftToRight == closeToLeft ? 0 : +1; setCurrentCellFromIndicator(indicatorOrientation, m_currentIndex, incr); } break; -- cgit v0.12