diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-03-23 12:36:43 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-03-23 12:36:43 (GMT) |
commit | e06d2bc80672776fc4fb0ca8a3861a4f9d493133 (patch) | |
tree | 14029eea6289427c632bf942a39b7949363bc2c8 | |
parent | 4accdf44eb486e603425c5ee69e05b973915f8a6 (diff) | |
download | Qt-e06d2bc80672776fc4fb0ca8a3861a4f9d493133.zip Qt-e06d2bc80672776fc4fb0ca8a3861a4f9d493133.tar.gz Qt-e06d2bc80672776fc4fb0ca8a3861a4f9d493133.tar.bz2 |
GraphicsViews: Focused widget is not visible after orientation change
If there is a graphicsview with input widget focused and splitview is
open, and we rotate the device from Portrait to Landscape
(or vice versa), the input widget is no longer visible in the
splitview rect. This only happens if there are scrollbars visible
in the view.
Reason is that the input widget is tried to ensure visibility for
before window surface is valid. In these cases, make the input widget
visibility re-location happen after window server indicates that the
view is now visible.
Task-number: QTBUG-17576
Reviewed-by: Guoqing Zhang
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 9d8dd41..767b974 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -330,6 +330,21 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE // This should also happen for commands. reset(); + if (event->windowServerEvent() && event->windowServerEvent()->Type() == EEventWindowVisibilityChanged) { + if (S60->splitViewLastWidget) { + QGraphicsView *gv = qobject_cast<QGraphicsView*>(S60->splitViewLastWidget); + const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff); + + if (alwaysResize) { + TUint visibleFlags = event->windowServerEvent()->VisibilityChanged()->iFlags; + if (visibleFlags & TWsVisibilityChangedEvent::EPartiallyVisible) + ensureFocusWidgetVisible(S60->splitViewLastWidget); + if (visibleFlags & TWsVisibilityChangedEvent::ENotVisible) + resetSplitViewWidget(true); + } + } + } + return false; } |