<?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[Escaping filter wildcard pattern in QFileDIalog]]></title><description><![CDATA[<p dir="auto">I have an application with an export as action which opens up a native QFileDialog.<br />
Since I want it to be able to filter for image files, e.g. PNG I have the following constructor</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qstring">@<bdi>QString</bdi></a> filename = QFileDialog::getSaveFileName(this, "Save plot as", "", "PNG image ( *.png )");@</p>
<p dir="auto">As expected this shows in the filter selection menu the option "PNG image". However I would like it to also explicitly show the corresponding wildcard pattern i.e. "PNG image (*.png)"<br />
The naive attempt:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qstring">@<bdi>QString</bdi></a> filename = QFileDialog::getSaveFileName(this, "Save plot as", "", "PNG image  ( *.png )( *.png )");@</p>
<p dir="auto">because the regex in the filter parser stops on the first one. How would I go about escaping this to get a literal "(*.png)" in the filter name.</p>
]]></description><link>https://forum.qt.io/topic/47110/escaping-filter-wildcard-pattern-in-qfiledialog</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 20:09:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/47110.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Oct 2014 17:44:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Escaping filter wildcard pattern in QFileDIalog on Thu, 16 Oct 2014 20:48:36 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">What is shown in the dialog is platform dependent. e.g. on OS X, if you only have one filter, it's not even shown, however, if you have several, the text of the filter including the parentheses and pattern is shown</p>
]]></description><link>https://forum.qt.io/post/247860</link><guid isPermaLink="true">https://forum.qt.io/post/247860</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 16 Oct 2014 20:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to Escaping filter wildcard pattern in QFileDIalog on Thu, 16 Oct 2014 20:00:59 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your response. I had already considered that option but I would still prefer to use parentheses</p>
]]></description><link>https://forum.qt.io/post/247853</link><guid isPermaLink="true">https://forum.qt.io/post/247853</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 16 Oct 2014 20:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to Escaping filter wildcard pattern in QFileDIalog on Thu, 16 Oct 2014 18:14:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet.<br />
you can not have “PNG image (<em>.png)” .<br />
but you can make a small change “PNG image [</em>.png] (<em>.png)” and pass it.<br />
then it will show PNG image [</em>.png] .</p>
<p dir="auto">hope this helps.</p>
]]></description><link>https://forum.qt.io/post/247846</link><guid isPermaLink="true">https://forum.qt.io/post/247846</guid><dc:creator><![CDATA[IamSumit]]></dc:creator><pubDate>Thu, 16 Oct 2014 18:14:02 GMT</pubDate></item></channel></rss>