<div dir="ltr"><div>What did you mean with "<i><span style="font-size:12.8px">in some parent </span><span style="font-size:12.8px">object and call the function from within the webview</span></i>"?</div><div></div>Solution below did not do the trick - link is still opened in the same webview...<div><br></div><div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">Item</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(128,0,0)">id</span><span style="font-family:arial,sans-serif">:</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(0,0,0)">htmlContentViewer</span><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>WebView<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="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="color:rgb(0,128,0)">//Qt.openUrlExternally(request.url)</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,0,0)">goExternal</span>(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"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">fancy</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Sailfish</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><span style="color:rgb(0,128,0)">WebView?</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><span style="color:rgb(0,128,0)">issue...</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">function</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">goExternal</span>(<span style="color:rgb(192,192,192)"> </span>url<span style="color:rgb(192,192,192)"> </span>)<span style="color:rgb(192,192,192)"> </span>{<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,85,175)">Qt</span>.openUrlExternally(url)<span style="color:rgb(192,192,192)"> </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px">}</pre></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-28 22:21 GMT+01:00 Michael Fuchs <span dir="ltr"><<a href="mailto:michfu@gmx.at" target="_blank">michfu@gmx.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Place the Qt.openUrlExternally(request.url) in a function in some parent<br>
object and call the function from within the webview.<br>
<div><div class="h5"><br>
On Donnerstag, 28. Jänner 2016 21:55:49 CET Zoltán Lutor wrote:<br>
> Hi,<br>
><br>
> Any idea how to open link clicked in webview in browser application?<br>
> Code below does not do the trick - rather opens link inside the webview<br>
> itself...<br>
><br>
> <a href="http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal" rel="noreferrer" target="_blank">http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal</a><br>
><br>
> WebView {<br>
><br>
> id: webViewer<br>
><br>
> anchors.fill: parent<br>
><br>
> onNavigationRequested : {<br>
><br>
> console.debug("request.url: ", request.url)<br>
><br>
> if (request.navigationType === WebView.LinkClickedNavigation) {<br>
><br>
> request.action = WebView.IgnoreRequest<br>
><br>
> Qt.openUrlExternally(request.url)<br>
><br>
> }<br>
><br>
> }<br>
><br>
> }<br>
><br>
><br>
> Thx,<br>
><br>
><br>
> Zoltan<br>
<br>
<br>
</div></div>_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><br>
</blockquote></div><br></div>