[Qt-interest] icons for files

Puneet Bisht pbisht at nivio.com
Tue May 5 14:27:27 CEST 2009


thanks for your reply

i have already tried QFileIconProvider , but the problem is ,it requires a
QFileInfo object and the file i want to show is on the server ,so i am
confused how to get the QFileInfo object for that file .

is there any other way


> QFileIconProvider is probably what you are looking for:
> http://doc.trolltech.com/4.5/qfileiconprovider.html
>
> Jens
>
>
> "Puneet Bisht" <pbisht at nivio.com> wrote in message
> news:6977.192.168.5.2.1241097508.squirrel at webmail.nivio.com...
>> hi all,
>>
>> i m working on a ftp application.
>> i m showing files on a server using qlistwidget, now i want to set icons
>> for files.
>> can anybody tell me how can i set system provided icons for a file
>> according to its extension e,g pdf,mp3 ...
>>
>> here i m using
>> item->setIcon(style()->standardIcon(QStyle::SP_DirIcon,0,this)); for
>> directories and
>> item->setIcon(style()->standardIcon(QStyle::SP_FileIcon,0,this)); for
>> file
>>
>> but i want to show different icons according to file extension.
>>
>> thanks in advance
>>
>> puneet
>
>
> --
> Jens Bache-Wiig - jbache at trolltech.com
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>




More information about the Qt-interest-old mailing list