Hi Timmy,

this is the wrong list for Qt questions (use Qt Interest for Questions unrelated to Qt Creator), but the short answer is to be found here http://lists.trolltech.com/qt-interest/2007-09/thread00030-0.html (it's about QLabel, but QLabel and the QML Text Element share the same infrastructure).

Cheers,
  Daniel

On 5/24/2011 9:01 PM, ext [email protected] wrote:

Hi there,

Our QML application displays text in RichText text format. Within this text element we have a hyperlinks that are constructed using HTML <a> tag. This links are displayed in the system link color regardless of the QML Text color property. As a result links will be blue although the text color is set to black. To apply a color to these links, I append css styling to the rich text content as follows:

Text{

text:"<styletype='text/css'>a:link{color:#FF0000} a:visited{color:#0000FF}</style>"+modelData

wrapMode:Text.Wrap

textFormat:Text.RichText

color:"#000000"

onLinkActivated:{console.log(link)}

}

This code works well in displaying the links in the specified color. However, the link does not seem to change state to visited as the link colors never change. It does not change to active or visited after clicking on the link despite link is activated. This case is also in the QML twitter example below. In the example, the links do not change color even after they are visited. Is there a way to change the link color after it is visited? Thank you very much.

http://doc.qt.nokia.com/4.7-snapshot/demos-declarative-twitter-twittercore-fatdelegate-qml.html

Best Regards,

Timmy Margo


_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator


--
Daniel Molkentin, Software Engineer,
Nokia, Qt Development Frameworks
website: http://qt.nokia.com
Rudower Chaussee 13, DE-12489 Berlin

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator

Reply via email to