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

Andre Somers andre at familiesomers.nl
Mon Mar 29 10:57:31 CEST 2010


On 29-3-2010 10:13, J-P Nurmi wrote:
> 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");
> }
>    

Interesting! I did not know about that little gem. I guess I should have 
read the documentation better myself as well. Sorry!
Every day something new to learn in Qt...

André






More information about the Qt-interest-old mailing list