views:

352

answers:

2
    QMessageBox::about( this, "About Application",
    "<h4>Application is a one-paragraph blurb</h4>\n\n"
"Copyright 1991-2003 Such-and-such. "
"For technical support, call 1234-56789 or see\n"
"<a href=\"http://www.such-and-such.com\"&gt;http://www.such-and-such.com&lt;/a&gt;" );

This code is creating the About message box which I wanted to have with two exceptions:

1) I would like to change the icon in the message box with an aaa.png file

2) And I would like to have the link clickable. It looks like hyperlink (it is blue and underlined) but mouse click does not work

Any ideas?

+1  A: 

For the icon, you need to just set the application icon. Something like this:

QApplication::setWindowIcon(QIcon(":/aaa.png")); // from a resource file

As for making the links clickable, I don't think it can be done with the QMessageBox::about API directly.

Evan Teran
OK, may be you could tell me, in general, how we can create a widget with hyperlinked text inside?
Narek
+1  A: 

I think you should create a custom QWidget for your about widget. By this way, you can put on the widget all you want. By example, you can place QLabel using the openExternalLinks property for clickable link.

To display a custom image on the QWidget, this example may help.

Patrice Bernassola