diff options
Diffstat (limited to 'src/declarative/fx')
-rw-r--r-- | src/declarative/fx/qfxlineedit.cpp | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextedit.cpp | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxwebview.cpp | 17 | ||||
-rw-r--r-- | src/declarative/fx/qfxwebview.h | 1 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/declarative/fx/qfxlineedit.cpp b/src/declarative/fx/qfxlineedit.cpp index e1d9f14..ccb0637 100644 --- a/src/declarative/fx/qfxlineedit.cpp +++ b/src/declarative/fx/qfxlineedit.cpp @@ -467,6 +467,7 @@ void QFxLineEdit::focusChanged(bool hasFocus) Q_D(QFxLineEdit); d->focused = hasFocus; setCursorVisible(hasFocus); + emit QFxItem::focusChanged(); } void QFxLineEdit::keyPressEvent(QKeyEvent* ev) diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 3013ac2..379e12f 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -885,6 +885,7 @@ void QFxTextEdit::keyReleaseEvent(QKeyEvent *event) void QFxTextEdit::focusChanged(bool hasFocus) { setCursorVisible(hasFocus); + emit QFxItem::focusChanged(); } /*! 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 diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h index 9003377..498cf2e 100644 --- a/src/declarative/fx/qfxwebview.h +++ b/src/declarative/fx/qfxwebview.h @@ -211,6 +211,7 @@ protected: void timerEvent(QTimerEvent *event); virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); + virtual void focusChanged(bool); private: void init(); |