Set QMessageBox icon to application icon

  • I wish the QMessageBox Icon enum also had ApplicationIcon and then it would use the already set application icon. If the application icon had not been set, no icon would be used.

  • Hi,

    I think this is a strange wish; QMessageBox icon is used to show what kind of Message you're showing.

    If you need something like you wish; you can write your custom class inherited from QDialog or QMessageBox.

  • IMHO the warning and critical icons should be used very sparingly in order to avoid overloading the user with messages that might make him/her panic.

    The question and information icons are non-standard (?) and look a bit clunky.

    99 times out of 100 I want to show no icon or the application icon.

    I think the Apple HIG says something similar to what I'm saying.

  • QMessageBox icon depends on Style.

    On Windows Xp (Qt5.0.2) all icons look fine.
    If you want customize Icon you could use setIconPixmap()

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.