Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML Text element hyperlink

In my QML Text element I want to have a hyperlink to a website and managed to do so with it looking like one etc. but when I click or touch it nothing happens, the link is supposed to open in a the default browser.

Text {     id: link_Text     text: '<html><style type="text/css"></style><a href="http://google.com">google</a></html>' } 

Any idea what I'm doing wrong?

like image 934
Gerharddc Avatar asked Sep 21 '12 18:09

Gerharddc


1 Answers

Ok I just found that I have to add this:

onLinkActivated: Qt.openUrlExternally(link) 

I did not originally consider something like this because I thought if the string was correctly formatted it would open the link on its own.

like image 131
Gerharddc Avatar answered Sep 28 '22 07:09

Gerharddc