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

Andre Somers andre at familiesomers.nl
Mon Mar 29 10:00:46 CEST 2010


J-P Nurmi wrote:
> On Mon, Mar 29, 2010 at 8:55 AM, Santhosh Y <santhosh at softjin.com> wrote:
>   
>> Hi,
>>
>> Would like to add icon to the "Help->About" dialog of my application.
>>
>> Currently I am using, QMessageBox::about ( QWidget * parent,
>> const QString & title, const QString & text).
>> for displaying my application specific information.
>>
>> I would like to add the logo of my organization to the above dialog.
>> Can I do this using QMessageBox.
>>
>> Please guide me in resolving this issue.
>>
>> Thanks in advance
>>
>> Regards,
>> Santhosh
>>
>>
>> --
>> ----------------------------------------------------
>> Y Santhosh Kumar -
>> Senior Software Engineer,
>> SoftJin Technologies Pvt Ltd,
>> www.softjin.com
>> ----------------------------------------------------
>>     
>
> Hi,
>
> Not to be rude, but please at least glance at the docs before asking
> such questions. Quoting QMessageBox::about() docs:
>
> about() looks for a suitable icon in four locations:
>
> 1. It prefers parent->icon() if that exists.
> 2. If not, it tries the top-level widget containing parent.
> 3. If that fails, it tries the active window.
> 4. As a last resort it uses the Information icon.
>
> Not clear enough?
>   
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é




More information about the Qt-interest-old mailing list