<?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[QFileSystemModel add Column]]></title><description><![CDATA[<p dir="auto">Hi there!</p>
<p dir="auto">I see that there are serval posts regarding this topic but all are rather old and none really added a column to QFileSystemModel. So is it really possible to add a column?</p>
<p dir="auto">My plan is to add two columns to hold a temp string per file and a bool value if this temp string was modified. This is what I did so far:</p>
<pre><code>    model = new FileModel(this);
    model-&gt;insertColumns(model-&gt;columnCount(),2);
</code></pre>
<p dir="auto">FileModel is my custom class that I derived from QFileSystemModel. I create indexes to access the two additional information like this:</p>
<pre><code>QModelIndex noteChanged = createIndex(index.row(), 5);
</code></pre>
<p dir="auto">And access the data like this:</p>
<pre><code>this-&gt;data(index);
</code></pre>
<p dir="auto">This is not working. Can it work in this way? I would like to use QFileSystemModel to have the option to rename files, add/delete files and watch a directory.</p>
<p dir="auto">Alternatively I was wandering if I could add additional roles to the model. Like a Qt::TempNote and Qt::NoteChanged role, which would hold my additional values.</p>
]]></description><link>https://forum.qt.io/topic/139627/qfilesystemmodel-add-column</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 07:02:13 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139627.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Sep 2022 20:32:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QFileSystemModel add Column on Tue, 27 Sep 2022 21:08:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You might want to check <a href="https://api.kde.org/frameworks/kitemmodels/html/classKExtraColumnsProxyModel.html" target="_blank" rel="noopener noreferrer nofollow ugc">KExtraColumnsProxyModel</a> to add your additional columns.</p>
]]></description><link>https://forum.qt.io/post/730417</link><guid isPermaLink="true">https://forum.qt.io/post/730417</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 27 Sep 2022 21:08:09 GMT</pubDate></item></channel></rss>