<?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 Traversal for Serialization]]></title><description><![CDATA[<p dir="auto">I'm trying to use the QFileSystemModel class to create a data model representing the file system on a remote unit.  The intent is for the control application, running on the remote unit, to serialize the QFileSystemModel object, send it via socket to a remote instance of a GUI, and have that GUI display the file system of the remote unit in a TreeView.</p>
<p dir="auto">I'm trying to understand how the file system structure is stored in the QFileSystemModel and having a lot of trouble "walking" the file system via the various QModelIndex functions.  I don't understand how the parent/child hierarchy is maintained in the model and how to get access to children at a given QModelIndex or model location.</p>
<p dir="auto">Is there some example of this being done in a QAbstractItemModel or QFileSystemModel?  At this point, I'm not asking for an implementation of serialization/deserialization -- I believe I understand that that's something I'm going to have to create myself, but I can't understand how to "walk" the model in order to serialize/deserialize.</p>
]]></description><link>https://forum.qt.io/topic/146051/qfilesystemmodel-traversal-for-serialization</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 23:47:04 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/146051.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Jun 2023 21:59:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QFileSystemModel Traversal for Serialization on Wed, 28 Jun 2023 22:40:58 GMT]]></title><description><![CDATA[<p dir="auto">There's the <a href="https://doc.qt.io/qt-6/qtwidgets-itemviews-simpletreemodel-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">Simple Tree Model example</a> that you can take inspiration from.</p>
]]></description><link>https://forum.qt.io/post/762950</link><guid isPermaLink="true">https://forum.qt.io/post/762950</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 28 Jun 2023 22:40:58 GMT</pubDate></item><item><title><![CDATA[Reply to QFileSystemModel Traversal for Serialization on Wed, 28 Jun 2023 15:22:38 GMT]]></title><description><![CDATA[<p dir="auto">This sounds good.  I like the speed and efficiency of the iterator, so that's a win.</p>
<p dir="auto">I'm searching now, but is there a decent way to create a model from something like a StringList or some other container that I would put the paths into, that I could use within a TreeView to display something like a nested directory listing?  Something roughly akin to the examples using the QFileSystemModel and TreeView?</p>
<p dir="auto">Thanks for the help you've already offered.  If I figure out something workable before I get a reply, I'll be back to update the post.</p>
]]></description><link>https://forum.qt.io/post/762912</link><guid isPermaLink="true">https://forum.qt.io/post/762912</guid><dc:creator><![CDATA[stickabee]]></dc:creator><pubDate>Wed, 28 Jun 2023 15:22:38 GMT</pubDate></item><item><title><![CDATA[Reply to QFileSystemModel Traversal for Serialization on Wed, 28 Jun 2023 06:16:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Beside the good suggestion of <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a>, you also have to take into account that QFileSystemModel is asynchronous and will only load data when required to avoid exhausting system resources when going through your hard drive.</p>
<p dir="auto">Since it's about showing information remotely, it's a model you should think about to minimize the traffic and the amount of processing required.</p>
]]></description><link>https://forum.qt.io/post/762823</link><guid isPermaLink="true">https://forum.qt.io/post/762823</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 28 Jun 2023 06:16:43 GMT</pubDate></item><item><title><![CDATA[Reply to QFileSystemModel Traversal for Serialization on Wed, 28 Jun 2023 05:26:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stickabee">@<bdi>stickabee</bdi></a> If you just want to collect a list of all subfolders and files on the remote machine then there is no need for QFileSystemModel. See <a href="https://stackoverflow.com/questions/8052460/recursively-iterate-over-all-the-files-in-a-directory-and-its-subdirectories-in" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/8052460/recursively-iterate-over-all-the-files-in-a-directory-and-its-subdirectories-in</a></p>
]]></description><link>https://forum.qt.io/post/762820</link><guid isPermaLink="true">https://forum.qt.io/post/762820</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 28 Jun 2023 05:26:41 GMT</pubDate></item></channel></rss>