API Documentation

Documentation for developing SailfishOS applications

LinkedLabel QML Type

A text paragraph with numbers and addresses automatically highlighted as links. More...

Import Statement: import Sailfish.Silica 1.0


Detailed Description

The LinkedLabel type provides a Sailfish-styled text paragraph with in-built parser that detects urls, phone numbers and email addresses, and highlightes them as tappable links. Tapping a link opens the app set as the default mime handler for the link type.

Contrary to other text elements, which use text property, the linked label text is set with the plainText property:

 import Sailfish.Silica 1.0

 LinkedLabel {
     plainText: "Linked label creates links for phone numbers like 0123456789, urls http://example.com and email addresses name@example.com."

By default the linked label follows general descriptive label coloring with the text painted in color Theme.highlightColor. The interactive links are shown in Theme.primaryColor. Note that within interactive items the colors are inverted, body text uses Theme.primaryColor and links Theme.highlightColor.

 import Sailfish.Silica 1.0

 ListItem {
     LinkedLabel {
         color: highlighted ? Theme.highlightColor : Theme.primaryColor
         linkColor: Theme.highlightColor
         plainText: "Company Ltd - http://example.com"

Property Documentation

defaultLinkActions : bool

Set this property to false to disable default link actions. You can add your own link handling by implementing onLinkActivated signal handler.

plainText : string

The text set in this property will be processed by link parser.

shortenUrl : bool

Set this property to true to display urls in short form within the text. For example url http://foobar.com will be shown as link "foobar.com".

We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.