diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-09-06 05:21:25 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-09-06 05:21:25 (GMT) |
commit | 00f34afa24a229915d1f2b00c02b93f5890fab3f (patch) | |
tree | 6f0d02b2694ba66c1093fbf5ee5571f4d762527d /src | |
parent | 8e22def6bb9c3a8e2ad9b7c8fc157c07d945989b (diff) | |
download | Qt-00f34afa24a229915d1f2b00c02b93f5890fab3f.zip Qt-00f34afa24a229915d1f2b00c02b93f5890fab3f.tar.gz Qt-00f34afa24a229915d1f2b00c02b93f5890fab3f.tar.bz2 |
Ensure WebView gets focus when an editable node is clicked on.
Task-number: QTBUG-13342
Reviewed-by: Michael Brasser
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp index c1ca23d..2d74d4b 100644 --- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -91,7 +91,6 @@ GraphicsWebView::GraphicsWebView(QDeclarativeWebView* parent) void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event) { - setFocus(); pressPoint = event->pos(); if (pressTime) { pressTimer.start(pressTime, this); @@ -101,6 +100,11 @@ void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event) parent->setKeepMouseGrab(true); } QGraphicsWebView::mousePressEvent(event); + + QWebHitTestResult hit = page()->mainFrame()->hitTestContent(pressPoint.toPoint()); + if (hit.isContentEditable()) + parent->forceActiveFocus(); + setFocus(); } void GraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) |