summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-24 01:29:59 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-08-24 01:29:59 (GMT)
commit4165b5af295f7cd2282676d836b6537ce3c76f69 (patch)
tree8710bd76b1a9eecdb9092ae9263e7a610fddad8f /src
parent23c9370fb8e25fc814fe057c7ad92f70f34a937b (diff)
downloadQt-4165b5af295f7cd2282676d836b6537ce3c76f69.zip
Qt-4165b5af295f7cd2282676d836b6537ce3c76f69.tar.gz
Qt-4165b5af295f7cd2282676d836b6537ce3c76f69.tar.bz2
Special handling of Tab/BackTab
This may need to be reconsidered with QML focus improvements, but for now, we simply ensure the webview behaves like a QWebView.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/fx/qfxwebview.cpp21
-rw-r--r--src/declarative/fx/qfxwebview.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index 9fc469a..347c9c2 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -783,6 +783,27 @@ void QFxWebView::keyReleaseEvent(QKeyEvent* event)
QFxPaintedItem::keyReleaseEvent(event);
}
+bool QFxWebView::sceneEvent(QEvent *event)
+{
+ Q_D(const QFxWebView);
+
+ if (d->interactive) {
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *k = static_cast<QKeyEvent *>(event);
+ if (k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) {
+ if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
+ page()->event(event);
+ if (event->isAccepted())
+ return true;
+ }
+ }
+ }
+ }
+ return QFxPaintedItem::sceneEvent(event);
+}
+
+
+
/*!
\qmlproperty action WebView::back
This property holds the action for causing the previous URL in the history to be displayed.
diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h
index d84a01c..40c86b4 100644
--- a/src/declarative/fx/qfxwebview.h
+++ b/src/declarative/fx/qfxwebview.h
@@ -215,6 +215,7 @@ protected:
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
virtual void focusChanged(bool);
+ virtual bool sceneEvent(QEvent *event);
private:
void init();