diff options
author | Tapani Mikola <tapani.mikola@nokia.com> | 2009-08-13 19:20:13 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-08-14 00:12:56 (GMT) |
commit | c0ea7090a6db60c315dae3534fcaf05d1b2591e1 (patch) | |
tree | d30306ab4b944a0cb23af183e0482332d699a13f /src/declarative/fx/qfxwebview.cpp | |
parent | afee70b2bd6b4eeaa85c24f148e51dcd985b6876 (diff) | |
download | Qt-c0ea7090a6db60c315dae3534fcaf05d1b2591e1.zip Qt-c0ea7090a6db60c315dae3534fcaf05d1b2591e1.tar.gz Qt-c0ea7090a6db60c315dae3534fcaf05d1b2591e1.tar.bz2 |
Fix to QFxWebView to show cursor in focused text input. Correction textedit and lineedit so that they emit focuschanged signals. Clean ups to webbrowser.qml.
Diffstat (limited to 'src/declarative/fx/qfxwebview.cpp')
-rw-r--r-- | src/declarative/fx/qfxwebview.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index 797e6cb..6645a0f 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -440,6 +440,20 @@ QVariant QFxWebView::evaluateJavaScript(const QString &scriptSource) return this->page()->mainFrame()->evaluateJavaScript(scriptSource); } +void QFxWebView::focusChanged(bool flag) +{ + QFocusEvent *e; + if (flag) { + e = new QFocusEvent (QEvent::FocusIn); + } + else { + e = new QFocusEvent (QEvent::FocusOut); + } + page()->event(e); + delete e; + emit QFxItem::focusChanged(); +} + void QFxWebView::expandToWebPage() { Q_D(QFxWebView); @@ -702,6 +716,7 @@ void QFxWebView::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_D(QFxWebView); if (d->interactive) { + setFocus (true); QMouseEvent *me = sceneMouseEventToMouseEvent(event); if (d->lastPress) delete d->lastPress; d->lastPress = me; @@ -709,7 +724,7 @@ void QFxWebView::mousePressEvent(QGraphicsSceneMouseEvent *event) event->setAccepted( /* It is not correct to send the press event upwards, if it is not accepted by WebKit - e.g. push button does not work, if done so as QGraohucsScene will not send the release event at all to WebKit + e.g. push button does not work, if done so as QGraphicsScene will not send the release event at all to WebKit Might be a bug in WebKit, though */ #if 1 //QT_VERSION <= 0x040500 // XXX see bug 230835 |