summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-06-29 10:24:44 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 13:07:12 +0300
commitb97f0bdf4b699bb4b3fe0758f5b04b6d74340491 (patch)
treee39d009e74cf8b6bf116c215602e775352dc3165
parentd6a9d6adde4ee478b6b7664590ef2fe4e1410db8 (diff)
downloadqt4-tools-b97f0bdf4b699bb4b3fe0758f5b04b6d74340491.tar.gz
Layout direction change by key should change alignment of QLineEdit
When QLineControl was split out of QLineEdit, a regression was introduced. When the layout direction was altered by a key press, the layout direction of the QLineControl would be set, but not the QLineEdit. This would in turn mean that QLineEdit would use the wrong layout direction for its visual alignment. Patch is a small hack to read back the layout direction from the control after it has been set. Task-number: QTBUG-11204 Reviewed-by: Trond (cherry picked from commit d198186cdb18bbb9428ca51e8771cc4fd9563452)
-rw-r--r--src/gui/widgets/qlineedit.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index c2ab6f509b..09a20c0904 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1665,8 +1665,11 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
}
#endif
d->control->processKeyEvent(event);
- if (event->isAccepted())
+ if (event->isAccepted()) {
+ if (layoutDirection() != d->control->layoutDirection())
+ setLayoutDirection(d->control->layoutDirection());
d->control->setCursorBlinkPeriod(0);
+ }
}
/*!