summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2010-06-05 19:11:50 (GMT)
committerLars Knoll <lars.knoll@nokia.com>2010-06-09 22:07:22 (GMT)
commit312c028d44a80f5d6029eb166a0de731f8452525 (patch)
tree906a77e853b332043af27e1d1d2a5f687c2ab146 /src/gui/kernel
parent0b06274858cab9cedace8e684d16664e49d5f814 (diff)
downloadQt-312c028d44a80f5d6029eb166a0de731f8452525.zip
Qt-312c028d44a80f5d6029eb166a0de731f8452525.tar.gz
Qt-312c028d44a80f5d6029eb166a0de731f8452525.tar.bz2
Handle setting the layoutDirection to Qt::LayoutDirectionAuto
Setting it to LayoutAuto will be ignored on an application level (only LeftToRight or RightToLeft are valid). On a widget level is does the same as calling unsetLayoutDirection(). Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 02d732b..52767b8 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -3544,7 +3544,7 @@ int QApplication::startDragDistance()
void QApplication::setLayoutDirection(Qt::LayoutDirection direction)
{
- if (layout_direction == direction)
+ if (layout_direction == direction || direction == Qt::LayoutDirectionAuto)
return;
layout_direction = direction;
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 895c85d..ab84a54 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -4828,6 +4828,11 @@ void QWidget::setLayoutDirection(Qt::LayoutDirection direction)
{
Q_D(QWidget);
+ if (direction == Qt::LayoutDirectionAuto) {
+ unsetLayoutDirection();
+ return;
+ }
+
setAttribute(Qt::WA_SetLayoutDirection);
d->setLayoutDirection_helper(direction);
}