[Interest] how to add the Application icon to the file which is generated from my Qt Application..... so that saved file shows the Application icon image ??????

Muthulingam Ammaiappan muthulingam.a at gmail.com
Thu Jan 19 06:56:54 CET 2012


Hi Jaco Naude,

Thanks for your Quick Reply...

here i am not talking about to set the application icon image to the
exe.... i had already implemented that functionality...

now i am interested to add the application icon image to the file which is
generated from my application....

you can see the attached image...(in that PDF files Shows the Adobe Reader
Icon image ,a nd MS Word files are showing MS Word Application Icon
Image...)

like that i wanted to show my application icon image to the file which is
generated from my application...

if you give some code snippet it will be really helpful...

Thanks & Regards,
Muthulingam


On Thu, Jan 19, 2012 at 11:13 AM, Jaco Naude <naude.jaco at gmail.com> wrote:

> Hi Muthulingam
>
> Do you mean your executable? In that case see
> http://doc.qt.nokia.com/4.7-snapshot/appicon.html.
>
> If you mean that you want to associate a specific file type with your
> application it becomes more difficult and it depends on the OS where you
> deploy your application.
> I have only done this on Windows and there is probably many ways to do it
> (and this is not really a Qt question), but here is my solution:
>
> I create my installers using NSIS and adding the following to the
> installer script will create a file association windows (Tested on
> XP,Vista,7):
>
> ;--------------------------------
> ; File Associations
> ;--------------------------------
> ; Write a file association to the registry for files with extension
> .yourextension files:
> WriteRegStr HKCR ".yourextension" "" "YourApplication.FileDescription"
> WriteRegStr HKCR "YourApplication.FileDescription" "" \
> "Your Application FileDescription"
> WriteRegStr HKCR "YourApplication.FileDescription\DefaultIcon" "" \
> "$INSTDIR\YourApplication.exe,0"
> WriteRegStr HKCR "YourApplication.FileDescription\shell\open\command" "" \
> '"$INSTDIR\YourApplication.exe" "-i" "%1"'
> WriteRegStr HKCR "YourApplication.FileDescription\shell\print\command" "" \
> '"$INSTDIR\YourApplication.exe" /p "-i" "%1"'
>
> You then need to handle a command line parameter which you will receive
> from windows when someone opens your file. In the above example it will
> look something like this:
> YourApplication.exe -i "File Path"
>
> Hope it helps,
> Cheers
> Jaco
>
>
>
> On Thu, Jan 19, 2012 at 7:21 AM, Muthulingam Ammaiappan <
> muthulingam.a at gmail.com> wrote:
>
>> Hi Friends,
>>
>> I wanted to add the Application Icon image to the file which is generated
>> from my Qt Application....
>>
>> so that the saved file should display the Application Icon Image.....
>>
>> (for example: PDF files shows the Adobe Reader Application Icon....)...
>>
>> can anyone help me to fix this problem????
>>
>> Thanks & Regards,
>> Muthulingam
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
>
> --
> Jaco Naude'
>
> Qtilities: Building blocks for Qt applications.
> http://www.qtilities.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120119/c7354648/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icondisplaysinfile.jpg
Type: image/jpeg
Size: 7471 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120119/c7354648/attachment.jpg>


More information about the Interest mailing list