<?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[Override default GUI and functionality of QFileDialog globally]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am  currently working with an open source aplication that uses the QtGui.QFileDialog.htm from PySide.<br />
<a href="https://doc.qt.io/qtforpython/PySide2/QtWidgets/QFileDialog.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qtforpython/PySide2/QtWidgets/QFileDialog.html</a></p>
<p dir="auto">This dialog is used hundreds of times in the application so manually replacing all instances is not really an option.</p>
<p dir="auto">I was hoping that there might be a way to override the current functionality of this dialog and replacing it with one of my own design. The one of my own design would talk to a server for its listing copy some files locally after a user selected them before allowing the application to continue normally.</p>
<p dir="auto">Any help would be great,</p>
]]></description><link>https://forum.qt.io/topic/110765/override-default-gui-and-functionality-of-qfiledialog-globally</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 01:05:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/110765.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 Jan 2020 16:06:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Override default GUI and functionality of QFileDialog globally on Sat, 18 Jan 2020 10:13:24 GMT]]></title><description><![CDATA[<p dir="auto">Thanks.<br />
This was really helpful.</p>
]]></description><link>https://forum.qt.io/post/572935</link><guid isPermaLink="true">https://forum.qt.io/post/572935</guid><dc:creator><![CDATA[mmiscool]]></dc:creator><pubDate>Sat, 18 Jan 2020 10:13:24 GMT</pubDate></item><item><title><![CDATA[Reply to Override default GUI and functionality of QFileDialog globally on Fri, 17 Jan 2020 19:37:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a><br />
So <em>that</em> is what "monkey patching" is?  [:shudders:]</p>
]]></description><link>https://forum.qt.io/post/572879</link><guid isPermaLink="true">https://forum.qt.io/post/572879</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 17 Jan 2020 19:37:00 GMT</pubDate></item><item><title><![CDATA[Reply to Override default GUI and functionality of QFileDialog globally on Fri, 17 Jan 2020 16:34:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">First thing: a good IDE would allow you to replace QFileDialog with your own class pretty easily and would be the right thing to do with regard to longterm maintenance and peace of mind.</p>
<p dir="auto">Now since it's python, you can apply some black magic. The brutal way to do it would be something like:</p>
<pre><code>import QtWidgets

class MyCoolFileDialog(QtWidgets.QWidget):
    ....
QtWidgets.QFileDialog = MyCoolFileDialog
</code></pre>
<p dir="auto">I am guessing that you might just be using one of the static method of QFileDialog, if that's the case, then just replace the static method rather that the whole class.</p>
<p dir="auto">The right term is monkey patching.</p>
<p dir="auto">You definitely want to put some warning somewhere about what you are doing here and document it properly.</p>
]]></description><link>https://forum.qt.io/post/572852</link><guid isPermaLink="true">https://forum.qt.io/post/572852</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 17 Jan 2020 16:34:39 GMT</pubDate></item></channel></rss>