[SailfishDevel] Webview and clicking on external link

Zoltán Lutor zoltan.lutor at gmail.com
Thu Jan 28 20:55:49 UTC 2016


Hi,

Any idea how to open link clicked in webview in browser application?
Code below does not do the trick - rather opens link inside the webview
itself...

http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal

WebView {

        id: webViewer

        anchors.fill: parent

        onNavigationRequested : {

            console.debug("request.url: ", request.url)

            if (request.navigationType === WebView.LinkClickedNavigation) {

                request.action = WebView.IgnoreRequest

                Qt.openUrlExternally(request.url)

            }

        }

    }


Thx,


Zoltan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20160128/eaa173af/attachment.html>


More information about the Devel mailing list