Results 1 to 2 of 2

Thread: creating a hyperlink

  1. #1
    Join Date
    Feb 2006
    Posts
    7
    Qt products
    Qt3
    Platforms
    Windows

    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="mailto:mail@host.com">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
    Location
    N.B. Canada
    Posts
    47
    Thanked 8 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    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:

    http://osdab.sourceforge.net/devcorner/urllabel.php

    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:

    http://www.qtcentre.org/forum/showthread.php?t=233

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

Similar Threads

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

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.