<?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[Set a default UNC path for QFileDialog]]></title><description><![CDATA[<p dir="auto">I wanted to open QFileDialog with a specific path like: //Machine/C$/Users/. I have implemented the following function but it doesn't work.</p>
<pre><code>void DownloadFM::on_pushButtonSource_clicked()
{
    QFileDialog o_dialogSource;
    o_dialogSource.setDirectory(absolutePath);
    QString fileName = QFileDialog::getOpenFileName(this, "Choose File");

    if(fileName.isEmpty())
        return;

    ui-&gt;lineEditSource-&gt;setText(fileName);
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/116104/set-a-default-unc-path-for-qfiledialog</link><generator>RSS for Node</generator><lastBuildDate>Sun, 25 Oct 2026 07:50:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/116104.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 20 Jun 2020 12:18:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Set a default UNC path for QFileDialog on Wed, 24 Jun 2020 20:30:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
So you can read/create files etc in //Machinex64/C$/Users/FolderSample2 ?<br />
its ONLY the QDir::rename that fails ?</p>
]]></description><link>https://forum.qt.io/post/602819</link><guid isPermaLink="true">https://forum.qt.io/post/602819</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 24 Jun 2020 20:30:46 GMT</pubDate></item><item><title><![CDATA[Reply to Set a default UNC path for QFileDialog on Wed, 24 Jun 2020 18:17:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/azadshahr">@<bdi>Azadshahr</bdi></a><br />
For my part, I cannot see any relation to whatever you are saying in your last post and setting a UNC path in a <code>QFileDialog</code>.  If you have some application privilege issue you should deal with that separately from a UNC issue.</p>
]]></description><link>https://forum.qt.io/post/602758</link><guid isPermaLink="true">https://forum.qt.io/post/602758</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 24 Jun 2020 18:17:04 GMT</pubDate></item><item><title><![CDATA[Reply to Set a default UNC path for QFileDialog on Sat, 20 Jun 2020 13:08:29 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, I should describe it more. However, I have a program which is works with the file system pretty well. I can create file/directory, rename file/directory, delete file/directory, and so on but when I wanted to move a directory to another place with using QDir::rename, it returns false to me. I give to this function two-path i.e. //Machinex64/C$/Users/FolderSample1 and //Machinex64/C$/Users/FolderSample2. When this function executed, it can't move the directory. Also, I give to application administrative privilege.</p>
]]></description><link>https://forum.qt.io/post/601977</link><guid isPermaLink="true">https://forum.qt.io/post/601977</guid><dc:creator><![CDATA[Azadshahr]]></dc:creator><pubDate>Sat, 20 Jun 2020 13:08:29 GMT</pubDate></item><item><title><![CDATA[Reply to Set a default UNC path for QFileDialog on Sat, 20 Jun 2020 13:04:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/azadshahr">@<bdi>Azadshahr</bdi></a><br />
Before proceeding: It would be nice to see a <code>qDebug() &lt;&lt; absolutePath</code>.  I have done enough support in this forum to know that when questioners say something like " with a specific path like: //Machine/C$/Users/" it can turn out that is <em>not</em> actually what they are passing....</p>
<p dir="auto">Furthermore, how do I know whether your app is running with sufficient privilege to read <code>\\Machine\C$</code>, which is an <em>administrative</em> share?  Have you tried other UNC shares, non-Administrative?</p>
<p dir="auto">Finally, all you have said is " following function but it doesn't work".  What <em>exactly</em> does "doesn't work" mean?  Where does the file dialog place you if the UNC is not accepted?</p>
]]></description><link>https://forum.qt.io/post/601976</link><guid isPermaLink="true">https://forum.qt.io/post/601976</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Sat, 20 Jun 2020 13:04:09 GMT</pubDate></item><item><title><![CDATA[Reply to Set a default UNC path for QFileDialog on Sat, 20 Jun 2020 12:53:09 GMT]]></title><description><![CDATA[<p dir="auto">So what should I do now?</p>
]]></description><link>https://forum.qt.io/post/601975</link><guid isPermaLink="true">https://forum.qt.io/post/601975</guid><dc:creator><![CDATA[Azadshahr]]></dc:creator><pubDate>Sat, 20 Jun 2020 12:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to Set a default UNC path for QFileDialog on Sat, 20 Jun 2020 12:43:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/azadshahr">@<bdi>Azadshahr</bdi></a><br />
I am not sure Qt file dialogs/operations support UNCs.</p>
]]></description><link>https://forum.qt.io/post/601974</link><guid isPermaLink="true">https://forum.qt.io/post/601974</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Sat, 20 Jun 2020 12:43:01 GMT</pubDate></item></channel></rss>