We have moved to a new Sailfish OS Forum. Please start new discussions there.

Link color in RichText Qml Label [answered]

asked 2013-12-28 15:24:26 +0300

Khertan gravatar image

Currently link in a RichText QML Component Label are displayed with a dark blue color, this didn't integrate well with the other component, but this could be unreadeable with some ambiances.

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by Khertan
close date 2014-01-11 09:28:20.993312

2 Answers

Sort by » oldest newest most voted

answered 2013-12-28 15:55:14 +0300

Tanghus gravatar image

You can add css to the text value:

Label {
    textFormat: Text.RichText;
    text: "<style>a:link { color: " + Theme.highlightColor + "; }</style>" +
          "<a href=https://together.jolla.com/'>Jolla2Gether</a>";
edit flag offensive delete publish link more


Thanks for the workarround

Khertan ( 2013-12-28 21:16:36 +0300 )edit

answered 2013-12-28 15:33:35 +0300

lbt gravatar image

See http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-text.html#linkColor-prop

This appears to be a limitation in Qt atm. You can work around it by including CSS which refers to the Theme.

Hmm I wonder if the default style can be linked to the Theme?

edit flag offensive delete publish link more

Question tools



Asked: 2013-12-28 15:24:26 +0300

Seen: 3,221 times

Last updated: Dec 28 '13