diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-02-25 17:22:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-06 07:56:56 +0100 |
commit | eb456f72052b02a77e22868bfa55a25d7af3e660 (patch) | |
tree | 2c2d8feb24587377fbbc4f984c3fa76e315b3341 | |
parent | 3e43b158ce158dc1285593d2c7555351033fc3ce (diff) | |
download | qttools-eb456f72052b02a77e22868bfa55a25d7af3e660.tar.gz |
Fix moving widgets in horizontal layouts in RTL mode.
Task-number: QTBUG-25872
Change-Id: Ia311b88f0ed3450d798bc5a9136e978c642d5b25
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
-rw-r--r-- | src/designer/src/lib/shared/qlayout_widget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp index 48118d74c..23c6885ee 100644 --- a/src/designer/src/lib/shared/qlayout_widget.cpp +++ b/src/designer/src/lib/shared/qlayout_widget.cpp @@ -57,6 +57,7 @@ #include <QtWidgets/QVBoxLayout> #include <QtWidgets/QGridLayout> #include <QtWidgets/QFormLayout> +#include <QtWidgets/QApplication> #include <QtGui/qevent.h> #include <QtCore/qdebug.h> @@ -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; |