Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML Text formatting causes href to be ignored



  • So it's possible to use RichText formatting for a Text object, including an anchor with an href, which is great, but has anyone noticed that if you have any tag before an href, that the href gets ignored? Is this a bug in the underlying text processing system?

    Text
    {
         text:
         qsTr("Here is some text")
             + "<br><br>"
             + qsTr("Here is a second line of text. Click here to go to google: <a href='https://www.google.com'>Google</a>.")
             + qsTr(" And that's all I have to say about that.")
    
         color: "black"
         linkColor: "moccasin"
    
         font.pixelSize: 12
         onLinkActivated: Qt.openUrlExternally(link)
    }
    

    The above will not recognize the href. If I remove the double line break, it works. I've tried explicitly setting the textFormat to RichText, but no luck.



  • @bradg It's working in my case. I'm working with Qt 5.5.


Log in to reply