diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-06-29 08:24:44 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-06-29 09:55:17 (GMT) |
commit | d198186cdb18bbb9428ca51e8771cc4fd9563452 (patch) | |
tree | e9396eab797d7199ad485cdb4d83e3bc37085078 /src/gui/widgets | |
parent | 85d4d3dececc3a51082273211170c524de15414f (diff) | |
download | Qt-d198186cdb18bbb9428ca51e8771cc4fd9563452.zip Qt-d198186cdb18bbb9428ca51e8771cc4fd9563452.tar.gz Qt-d198186cdb18bbb9428ca51e8771cc4fd9563452.tar.bz2 |
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
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index f041a36..6e8daee 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); + } } /*! |