[SailfishDevel] baseUrl in Text Items

Michael Fuchs michfu at gmx.at
Fri Apr 20 13:23:27 UTC 2018


Hi,

The documentation [1] says about Text.baseUrl :
"This property specifies a base URL which is used to resolve relative 
URLs within the text."

...followed by some examples how the links will be genrated.

But I can't reproduce this behaviour

Label {
     text: '<a href="asdasd.html">link</a>'
     baseUrl: "http://www.asd.at/"
     onLinkActivated: console.log(link)
}

No matter what I set baseUrl to, "link" in linkActivated(link) will be 
just the value assigend to href attribute.

I know how to workaround this problem (e.g. use Qt.resolvedUrl(baseUrl + 
link) works for most cases) but has anybody got it working like it is 
described in the docs?


regards, Michael.

[1] https://doc.qt.io/qt-5.6/qml-qtquick-text.html#baseUrl-prop


More information about the Devel mailing list