[Qt-interest] Adding icon to the "About Dialog" of my application.

J-P Nurmi jpnurmi at gmail.com
Mon Mar 29 10:13:54 CEST 2010


On Mon, Mar 29, 2010 at 10:00 AM, Andre Somers <andre at familiesomers.nl> wrote:
> I *think*, that the icon Santhosh was refering to, was not the window
> icon, but the larger Question, Information, Warning or Critical icon
> that is displayed inside the dialog. Still, you are right that even the
> way to change that icon, is nicely documented
> (QMessageBox::setIconPixmap). Of course, there is no static conveneance
> function you can use in that case. Instead, you can just use the second
> constructor, call setIconPixmap, and then call exec() to get to what you
> want.
>
> André

Try it out ;-)

#include <QtGui>

int main (int argc, char* argv[])
{
    QApplication app(argc, argv);
    app.setWindowIcon(app.style()->standardIcon(QStyle::SP_TrashIcon));
    QMessageBox::about(0, "title", "text");
}

--
J-P Nurmi




More information about the Qt-interest-old mailing list