Results 1 to 2 of 2

Thread: creating a hyperlink

  1. #1
    Join Date
    Feb 2006
    Qt products

    Default creating a hyperlink

    I'm working with a dialog box in Qt 3.2.1 and I'm trying to create a hyperlink using either a text edit or a text label. I tried the following with both:

    <a href="">click here</a>

    With the text edit, the tags were displayed along with the text. With the text label, the words "click here" were displayed and were blue and underlined, but the link didn't exist (nothing happened when I clicked on or moved my mouse pointer over the words).

    What am I missing?

  2. #2
    Join Date
    Jan 2006
    N.B. Canada
    Thanked 8 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Unix/X11 Windows

    Default Re: creating a hyperlink

    This is the expected behaviour. QLabel doesn't handle clicking of links. In fact Qt is unable to just "open a browser" and go to the link.

    You can try this:

    This is a QLabel, based on KURLLabel, that has a signal for when it is clicked. Note however, that you still have to handle openning of the browser yourself in the connected slot.

    Here's some info regarding that:

    The march of progress:
    printf("%10.2f", x);
    cout << setw(10) << setprecision(2) << showpoint << x;
    java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
    String s = formatter.format(x);
    for (int i = s.length(); i < 10; i++) System.out.print(' ');

Similar Threads

  1. Linking Error when Creating DLL with Visual Studio
    By stretchtiberius in forum Qt Programming
    Replies: 6
    Last Post: 10th February 2009, 19:31
  2. Help needed in creating Tree Model.
    By kaushal_gaurav in forum Qt Programming
    Replies: 5
    Last Post: 18th December 2008, 12:14
  3. Creating pages
    By hgedek in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2007, 15:11
  4. Problem in creating thread in GUI application
    By jyoti kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:05
  5. uic not creating seperate .h and .cpp files
    By Kapil in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2006, 10:43


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.