PDA

View Full Version : how to use linkActivated()



rmagro
1st February 2008, 15:33
Hi all,

I have the following label in which I put a link..

I would like to open the google web site when I click to the text..
How to do it ?

The following code doen not work ...What am I missing?



QLbel *serverLabel = new QLabel();

serverLabel->setText(tr("<a style='color: red;' href='http://www.google.com'>HIT HERE</a>"));

jpn
1st February 2008, 17:11
Hi. Take a closer look at QLabel docs. There's a property which adjusts whether external links are opened or not.

rmagro
1st February 2008, 17:29
WOW..

Your suggestions are always illuminating..

I used


serverLabel->setOpenExternalLinks(true);


It works perfectly..

many thanks once again