<div dir="ltr">Hi,<div><br></div><div>Any idea how to open link clicked in webview in browser application?</div><div>Code below does not do the trick - rather opens link inside the webview itself...</div><div><br></div><div><a href="http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal">http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal</a><br></div><div><br></div><div>WebView<span style="color:rgb(192,192,192)"> </span>{<br></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">id</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">webViewer</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">anchors.fill</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">parent</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>onNavigationRequested<span style="color:rgb(192,192,192)"> </span>:<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,85,175)">console</span>.debug(<span style="color:rgb(0,128,0)">"request.url:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span>,<span style="color:rgb(192,192,192)"> </span>request.url)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(request.navigationType<span style="color:rgb(192,192,192)"> </span>===<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WebView</span>.LinkClickedNavigation)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>request.action<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WebView</span>.IgnoreRequest</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,85,175)">Qt</span>.openUrlExternally(request.url)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>}</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Thx,</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Zoltan</pre></div></div>