Results 1 to 6 of 6

Thread: Clickable URL in QMessageBox?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Cherry Hill, NJ USA
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Clickable URL in QMessageBox?

    I would like to display a URL in a QMessageBox that can be clicked on to follow the link.

    Is there a way to do this? As an alternative, I could use another kind of dialog and check for the mouse hovering over the text to change the cursor, etc.

    I would very much appreciate it if someone has a solution that would save me a lot of time?

    Thanks,
    Martin

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Clickable URL in QMessageBox?

    You can use QLabel with QLabel::setOpenExternalLinks set to true

  3. #3
    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: Clickable URL in QMessageBox?

    Works for me:
    Qt Code:
    1. QMessageBox::about(0, "Trolltech", "<a href='http://www.trolltech.com'>Trolltech</a>");
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  4. #4
    Join Date
    Nov 2009
    Location
    Paris/France
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Clickable URL in QMessageBox?

    Quote Originally Posted by jpn View Post
    Works for me:
    Qt Code:
    1. QMessageBox::about(0, "Trolltech", "<a href='http://www.trolltech.com'>Trolltech</a>");
    To copy to clipboard, switch view to plain text mode 
    I came here googling for this very same problem. I still can't click on links in ::about() box. The link appears as such (blue, underlined), but clicking on it doesnt open anything. I'm using Qt 4.5.3 on linux/gentoo, and i know the general 'open a link' stuff works from within Qt on other application (starts firefox on my computer)

    I did try exactly the line quoted here.

Similar Threads

  1. QMessageBox buttons appearance
    By yartov in forum Qt Programming
    Replies: 6
    Last Post: 26th June 2008, 01:36
  2. Replies: 2
    Last Post: 23rd May 2008, 13:22
  3. Display row Number in QMessageBox
    By arunvv in forum Newbie
    Replies: 6
    Last Post: 1st May 2008, 23:24
  4. Re: Help on QMessageBox
    By arunvv in forum Newbie
    Replies: 2
    Last Post: 25th March 2008, 23:45
  5. QMessageBox problem in Qtopia
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 8th February 2008, 09:22

Tags for this Thread

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.