[Qt-interest] icons for files

Jens Bache-Wiig jbache at trolltech.com
Tue May 5 09:13:46 CEST 2009


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




More information about the Qt-interest-old mailing list