<?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[[SOLVED] QFileDialog no longer remembers directory between runs]]></title><description><![CDATA[<p dir="auto">I'm developing with Qt/MinGW on Windows 8.</p>
<p dir="auto">It seems that the behavior of QFileDialog changed somewhere between Qt 5.1.1 and Qt 5.3.1 when creating an instance of QFileDialog (my instance is called fileDialog) and simply using:</p>
<p dir="auto">@QStringList fileNames = fileDialog.getOpenFileNames(this, "Select File(s)", "",<br />
"Images (" + imageWildcardString() + ")");@</p>
<p dir="auto">The same app compiled with 5.1.1 remembered the last directory used between runs (even when not run from within Qt Creator). It wasn't necessary to save any settings to get this behavior. The one compiled with Qt 5.3 doesn't. The directory changes are still remembered though for an instance of QDialog used multiple times within a single app run.</p>
<p dir="auto">I think the problem may be related to QDialog::directory() that doesn't seem to have changed after I browsed somewhere with the dialog (even if I finally press OK and not Cancel). It seems to be stuck at the working directory.</p>
<p dir="auto">Any bug confirmation or workaround would be greatly appreciated.</p>
<p dir="auto">Eon</p>
]]></description><link>https://forum.qt.io/topic/43576/solved-qfiledialog-no-longer-remembers-directory-between-runs</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 22:46:54 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/43576.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 11 Jul 2014 09:09:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] QFileDialog no longer remembers directory between runs on Fri, 11 Jul 2014 14:16:40 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="Jeroentje@home" date="1405084930"]Below your avatar there is an 'edit' link. Do this at your first post and place the [SOLVED] before the header ;-)<br />
Greetz[/quote]</p>
<p dir="auto">Thanks :)</p>
]]></description><link>https://forum.qt.io/post/235511</link><guid isPermaLink="true">https://forum.qt.io/post/235511</guid><dc:creator><![CDATA[Eonz]]></dc:creator><pubDate>Fri, 11 Jul 2014 14:16:40 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog no longer remembers directory between runs on Fri, 11 Jul 2014 13:22:10 GMT]]></title><description><![CDATA[<p dir="auto">Below your avatar there is an 'edit' link. Do this at your first post and place the [SOLVED] before the header ;-)<br />
Greetz</p>
]]></description><link>https://forum.qt.io/post/235505</link><guid isPermaLink="true">https://forum.qt.io/post/235505</guid><dc:creator><![CDATA[Jeroentjehome]]></dc:creator><pubDate>Fri, 11 Jul 2014 13:22:10 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog no longer remembers directory between runs on Fri, 11 Jul 2014 11:08:23 GMT]]></title><description><![CDATA[<p dir="auto">OK so I realize now that getOpenFileNames() is a static function and so of course fileDialog.directory() wouldn't be updated. I guess I've been using it wrong.</p>
<p dir="auto">I think the specific behavior related to passing "" as the default dir is what changed.</p>
<p dir="auto">What I'm going to do for a workaround is just use the path from the first selected file name  returned as the path to save using QSettings.</p>
<p dir="auto">Edit: The above workaround works.</p>
<p dir="auto">Now how do I mark this tread as resolved?</p>
]]></description><link>https://forum.qt.io/post/235496</link><guid isPermaLink="true">https://forum.qt.io/post/235496</guid><dc:creator><![CDATA[Eonz]]></dc:creator><pubDate>Fri, 11 Jul 2014 11:08:23 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog no longer remembers directory between runs on Fri, 11 Jul 2014 10:32:12 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="Jeroentje@home" date="1405073985"]Might want to utilize the QSettings and at startup load the last used directory. If valid, change the current working directory of the application. That should do the trick.[/quote]</p>
<p dir="auto">That's exactly what I tried to do when I noticed that fileDialog.directory() also doesn't update when I browse to a directory. So I can't obtain the last used directory.</p>
]]></description><link>https://forum.qt.io/post/235486</link><guid isPermaLink="true">https://forum.qt.io/post/235486</guid><dc:creator><![CDATA[Eonz]]></dc:creator><pubDate>Fri, 11 Jul 2014 10:32:12 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog no longer remembers directory between runs on Fri, 11 Jul 2014 10:19:45 GMT]]></title><description><![CDATA[<p dir="auto">Might want to utilize the QSettings and at startup load the last used directory. If valid, change the current working directory of the application. That should do the trick.</p>
]]></description><link>https://forum.qt.io/post/235487</link><guid isPermaLink="true">https://forum.qt.io/post/235487</guid><dc:creator><![CDATA[Jeroentjehome]]></dc:creator><pubDate>Fri, 11 Jul 2014 10:19:45 GMT</pubDate></item></channel></rss>