View Single Post
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1
I have a page which deals with displaying messages produced from an external source, so far, all is working well.

Currently, when a message has been generated by the external source, the message may contain a link to take you to the operators website for further information, by clicking the link, sailfish-browser is opened, but I would actually prefer WebView to handle the page, but how do I make this work, here's my code so far;


StationMessages.qml

Code:
            Label {
                id: message
                text: model.message
                width: parent.width
                wrapMode: Text.WordWrap
                textFormat: Text.RichText
                x: Theme.horizontalPageMargin + Theme.paddingMedium
                anchors {
                    top: parent.top
                    topMargin: Theme.paddingLarge
                    horizontalCenter: parent.hoizontalCenter
                }
                onLinkActivated: Qt.openUrlExternally(link)
The Webview page set up, but how to link the two pages, for some reason, I cannot wrap my head round this or find any examples;


MessageView.qml

Code:
Page {
    SilicaWebView {
        anchors.fill: parent
        header: PageHeader { title: "Message view" }
        url: ???
    }
}
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post: