Results 1 to 3 of 3

Thread: how to use linkActivated()

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question how to use linkActivated()

    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?

    Qt Code:
    1. QLbel *serverLabel = new QLabel();
    2.  
    3. serverLabel->setText(tr("<a style='color: red;' href='http://www.google.com'>HIT HERE</a>"));
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to use linkActivated()

    Hi. Take a closer look at QLabel docs. There's a property which adjusts whether external links are opened or not.
    J-P Nurmi

  3. #3
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to use linkActivated()

    WOW..

    Your suggestions are always illuminating..

    I used
    Qt Code:
    1. serverLabel->setOpenExternalLinks(true);
    To copy to clipboard, switch view to plain text mode 

    It works perfectly..

    many thanks once again

Similar Threads

  1. linkActivated
    By dragon in forum Qt Programming
    Replies: 6
    Last Post: 11th October 2007, 19:12
  2. QLabel's linkActivated() signal in QT 4.2
    By gsQT4 in forum Qt Programming
    Replies: 9
    Last Post: 16th March 2007, 14:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.