Search code examples
qmlblackberry-10

Link in Label BlackBerry 10


I am using JSON to receive data and place it into List. There is a Label displaying the text that I am receiving from the JSON. In some of the cases there is a Link in the text. By default you can't click on the Link from the label. Is there a way to make the Link to be clickable?

Label {
       text:  "Click here to open browser and get redirected to www.stackoverflow.com";
       }

The output is "Click here to open browser and get redirected to www.stackoverflow.com" but the Link to StackOverflow is not clickable.


Solution

  • Use TextArea instead of Label and set property editable to false, it would look same as Label. Don't forget to set inputMode to either Text or Chat.

    TextArea {
            text: "http://www.google.com"
            editable: false
            inputMode: TextAreaInputMode.Text
    }