diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-10 00:38:55 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-10 00:38:55 (GMT) |
commit | d222608c961c0b2dd5509488e5aa89864aafb675 (patch) | |
tree | 398b0017a87a24efdb5d1ce7c1de256394ca849a /src/declarative/fx | |
parent | 94badeee58b6d81ba01966fa21461f31b51fa206 (diff) | |
download | Qt-d222608c961c0b2dd5509488e5aa89864aafb675.zip Qt-d222608c961c0b2dd5509488e5aa89864aafb675.tar.gz Qt-d222608c961c0b2dd5509488e5aa89864aafb675.tar.bz2 |
Add a WebView::evaluateJavaScript() method
Authored-by: Tapani Mikola
Diffstat (limited to 'src/declarative/fx')
-rw-r--r-- | src/declarative/fx/qfxwebview.cpp | 9 | ||||
-rw-r--r-- | src/declarative/fx/qfxwebview.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index 47199ef..d9108f3 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -416,6 +416,15 @@ void QFxWebView::setInteractive(bool i) emit interactiveChanged(); } +/*! + Evaluates the \a scriptSource JavaScript inside the main frame + context and returns the result of the last executed statement. +*/ +QVariant QFxWebView::evaluateJavaScript(const QString &scriptSource) +{ + return this->page()->mainFrame()->evaluateJavaScript(scriptSource); +} + void QFxWebView::expandToWebPage() { Q_D(QFxWebView); diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h index 1200162..64b9176 100644 --- a/src/declarative/fx/qfxwebview.h +++ b/src/declarative/fx/qfxwebview.h @@ -178,6 +178,9 @@ Q_SIGNALS: void singleClick(); void doubleClick(); +public Q_SLOTS: + QVariant evaluateJavaScript (const QString&); + private Q_SLOTS: void expandToWebPage(); void paintPage(const QRect&); |