summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-06-24 18:36:15 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-06-24 18:42:38 +0200
commit68c4131a416fc002ea8f025478c30d969de5f03d (patch)
tree2778628759cb9892e0a7a776b8531d70bc01a562
parent986f1fc7829248bbcf0fe84471cbf48c932908ce (diff)
Force active focus for touch begin and loose it for focusOutEvent
This fixes the focusing issues on touch devices. Change-Id: I26c0080ea70aeabbd608e15fbd3705b907bdb68e Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
index 8d7f298e..822cea4b 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -147,11 +147,13 @@ void RenderWidgetHostViewQtDelegateQuick::inputMethodStateChanged(bool editorVis
void RenderWidgetHostViewQtDelegateQuick::focusInEvent(QFocusEvent *event)
{
+ setFocus(true);
m_client->forwardEvent(event);
}
void RenderWidgetHostViewQtDelegateQuick::focusOutEvent(QFocusEvent *event)
{
+ setFocus(false);
m_client->forwardEvent(event);
}
@@ -189,6 +191,8 @@ void RenderWidgetHostViewQtDelegateQuick::wheelEvent(QWheelEvent *event)
void RenderWidgetHostViewQtDelegateQuick::touchEvent(QTouchEvent *event)
{
+ if (event->type() == QEvent::TouchBegin && !hasActiveFocus())
+ forceActiveFocus();
m_client->forwardEvent(event);
}