<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Custom icons for QFileSystemModel]]></title><description><![CDATA[<p dir="auto">Hi ,<br />
I was wondering if anybody knew of a way to use custom icons the file system uses to show your files/folders....The Doc has pointed me to  <em>QFileIconProvider</em> but i did not find anyway to match "<em>QFileIconProvider::IconType</em>":<a href="http://qt-project.org/doc/qt-5.1/qtwidgets/qfileiconprovider.html#IconType-enum" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5.1/qtwidgets/qfileiconprovider.html#IconType-enum</a> to the custom icons of my choosing.</p>
<p dir="auto">Any help would be appreciated.</p>
]]></description><link>https://forum.qt.io/topic/30112/custom-icons-for-qfilesystemmodel</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 13:42:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/30112.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 31 Jul 2013 07:53:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom icons for QFileSystemModel on Thu, 01 Aug 2013 06:12:13 GMT]]></title><description><![CDATA[<p dir="auto">i haven't looked into the sources of QFileSystemModel yet, but i would bet that it queries the icon from the QFileIconProvider in it's data() method implementation for the decoration role. (In the way like i stated it in the code before)</p>
]]></description><link>https://forum.qt.io/post/188927</link><guid isPermaLink="true">https://forum.qt.io/post/188927</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 01 Aug 2013 06:12:13 GMT</pubDate></item><item><title><![CDATA[Reply to Custom icons for QFileSystemModel on Thu, 01 Aug 2013 00:47:46 GMT]]></title><description><![CDATA[<p dir="auto">Thanks raven-worx for the reply.</p>
<p dir="auto">[quote author="raven-worx" date="1375263368"]<br />
What exactly do you mean?<br />
[/quote]</p>
<p dir="auto">I thought I could use QFileInfoProvider to set the icons that QFileSystemModel uses to show the icons for files/folders.If this could be done there should be some kind of setIcon()/setIcons() function to set them right?</p>
<p dir="auto">May be I am getting wrong the intended usage of QFileInfoProvider.</p>
]]></description><link>https://forum.qt.io/post/188900</link><guid isPermaLink="true">https://forum.qt.io/post/188900</guid><dc:creator><![CDATA[musimbate]]></dc:creator><pubDate>Thu, 01 Aug 2013 00:47:46 GMT</pubDate></item><item><title><![CDATA[Reply to Custom icons for QFileSystemModel on Wed, 31 Jul 2013 09:36:08 GMT]]></title><description><![CDATA[<p dir="auto">alternatively you can also subclass QFileIconProvider as you already mentioned and reimplement all virtual methods. And set the file icon provider class with QFileSystemModel::setIconProvider(yourIconProvider).</p>
<p dir="auto">[quote author="musimbate" date="1375257223"]Hi ,<br />
but i did not find anyway to match "<em>QFileIconProvider::IconType</em>":<a href="http://qt-project.org/doc/qt-5.1/qtwidgets/qfileiconprovider.html#IconType-enum" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5.1/qtwidgets/qfileiconprovider.html#IconType-enum</a> to the custom icons of my choosing.[/quote]<br />
What exactly do you mean?</p>
]]></description><link>https://forum.qt.io/post/188731</link><guid isPermaLink="true">https://forum.qt.io/post/188731</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 31 Jul 2013 09:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to Custom icons for QFileSystemModel on Wed, 31 Jul 2013 09:31:18 GMT]]></title><description><![CDATA[<p dir="auto">subclass QFileSystemModel and reimplement data() method. The following should do what you want:<br />
@<br />
QVariant MyFileModel::data ( const QModelIndex &amp; index, int role ) const<br />
{<br />
if( index.column() == 0 &amp;&amp; role == Qt::DecorationRole )<br />
//you may want to check "index.data().toString()" for the file-name/-extension<br />
return QVariant::fromValue(icon);<br />
else<br />
return QFileSystemModel::data(index, role);<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/188729</link><guid isPermaLink="true">https://forum.qt.io/post/188729</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 31 Jul 2013 09:31:18 GMT</pubDate></item></channel></rss>