Commit e287590a authored by Kai Koehne's avatar Kai Koehne
Browse files

Doc: Sanitize WebEngineView::newViewRequested code snippet


Use ; in JavaScript snippets. Also, use = function(x) notation
for slots that get an argument.

Change-Id: Iba6ffe94f882cae2b31022f4f80482ea6c922fde
Reviewed-by: default avatarPeter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: default avatarMichal Klocek <michal.klocek@qt.io>
Showing with 5 additions and 5 deletions
...@@ -57,8 +57,8 @@ QtObject { ...@@ -57,8 +57,8 @@ QtObject {
id: windowParent id: windowParent
// Create the initial browsing windows and open the startup page. // Create the initial browsing windows and open the startup page.
Component.onCompleted: { Component.onCompleted: {
var firstWindow = windowComponent.createObject(windowParent) var firstWindow = windowComponent.createObject(windowParent);
firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open(&quot;http://qt.io&quot;)">') firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open(&quot;http://qt.io&quot;)">');
} }
property Component windowComponent: Window { property Component windowComponent: Window {
...@@ -74,9 +74,9 @@ QtObject { ...@@ -74,9 +74,9 @@ QtObject {
// Handle the signal. Dynamically create the window and // Handle the signal. Dynamically create the window and
// use its WebEngineView as the destination of our request. // use its WebEngineView as the destination of our request.
onNewViewRequested: { onNewViewRequested: function(request) {
var newWindow = windowComponent.createObject(windowParent) var newWindow = windowComponent.createObject(windowParent);
request.openIn(newWindow.webView) request.openIn(newWindow.webView);
} }
} }
} }
......
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