Commit a99fdc02 authored by Pierre Rossi's avatar Pierre Rossi Committed by The Qt Project
Browse files

Implement QWebEnginePage::runJavaScript


We can't have QWebFrame::evaluateJavascript in its old form for
several reasons, the first of which being that we don't have a
QWebEngineFrame class anymore. This is worked around by adding
an optional QString parameter with the frame's XPath.

Another issue is that the WebKit1 API was synchronous, and this would
not play nicely with the very asynchronous nature of chromium we're
now sitting on top of. In order to make this obvious when porting, we
rename it to runJavaScript which doesn't return any result.

This also introduces a template member function overload that will
accept function pointers, functors and lambdas,much like Qt5's new
signal/slot syntax, in order to get the result of the javascript
evaluation back.

Change-Id: I64e15a6f5a168936c52a4da2cef6285dfd16e0d5
Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
parent 1b3be641
Showing with 165 additions and 4 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment