diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-06-17 09:23:09 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-06-17 09:23:09 (GMT) |
commit | b133f1b45638dd10bd5400393d83ca1bed1985c4 (patch) | |
tree | 55ff2272ed8a4c23c98c2f81870e2f3b2589b284 /src/gui/inputmethod | |
parent | be24f3c83e03118fb2dba3e59db44b1f600a6a63 (diff) | |
download | Qt-b133f1b45638dd10bd5400393d83ca1bed1985c4.zip Qt-b133f1b45638dd10bd5400393d83ca1bed1985c4.tar.gz Qt-b133f1b45638dd10bd5400393d83ca1bed1985c4.tar.bz2 |
Ensure visibility of input widget in QML app when doing layout switch
When QML application changes orientation, it usually switches to a new
layout that lays out widgets differently (ie. in portrait, one vertical
column; in landscape, horizontal multi-column layout).
This easily breaks splitview translation logic, since it tries to ensure
the visibility of the input widget before the new layout has been
applied.
Additionally, the logic failed, when connected signal was fired, since
it assumed that the new translation would have translated the view above
from where it started from (i.e. window below the translated view would
have been exposed) and thus, it didn't do anything.
As a fix, when translation logic seems to indicate that the translation
would fail (and thus previously wouldn't do anything), reset the
existing translation and try again.
Task-number: QTBUG-16785
Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 3a12d26..fcb809c 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -912,8 +912,14 @@ void QCoeFepInputContext::translateInputWidget() qreal dy = -(qMin(maxY, (cursor.bottom() - vkbRect.top() / 2))); // Do not allow transform above screen top. - if (m_transformation.height() + dy > 0) + if (m_transformation.height() + dy > 0) { + // If we already have some transformation, remove it. + if (m_transformation.height() < 0) { + rootItem->resetTransform(); + translateInputWidget(); + } return; + } rootItem->setTransform(QTransform::fromTranslate(0, dy), true); } |