<?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::getSaveFileName - dialog is shown more then one time by call]]></title><description><![CDATA[<p dir="auto">I have next code:<br />
@<br />
QImage image(centralWidget_-&gt;rect().size(), QImage::Format_RGB32);<br />
QPainter painter (&amp;image);<br />
painter.setRenderHint(QPainter::Antialiasing, true);<br />
// Model is QGraphicsScene subclass<br />
model_-&gt;clearSelection();<br />
model_-&gt;render(&amp;painter);</p>
<pre><code>QString fileName = QFileDialog::getSaveFileName(NULL,
                                                tr("export as image:"),
                                                QDir::homePath(),
                                                QString(tr("Images: *.png *.jpg"))
                                                );

if (!fileName.isEmpty()) {
    image.save(fileName);
}
</code></pre>
<p dir="auto">.......<br />
@<br />
When file's name has been chosen and i have pushed "save" button, this dialog appears again.<br />
I use Qt 5.2 on debian linux.</p>
]]></description><link>https://forum.qt.io/topic/41779/solved-qfiledialog-getsavefilename-dialog-is-shown-more-then-one-time-by-call</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 21:16:11 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/41779.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 May 2014 21:44:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 22:39:53 GMT]]></title><description><![CDATA[<p dir="auto">You're welcome !</p>
<p dir="auto">Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)</p>
]]></description><link>https://forum.qt.io/post/229668</link><guid isPermaLink="true">https://forum.qt.io/post/229668</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 May 2014 22:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 22:38:01 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="SGaist" date="1400884197"]The problem is that these pieces of code don't tell much. Somewhere you are connecting something at least twice. So where does that connect happen and why several times ?[/quote]</p>
<p dir="auto">You are right. Error was in connectModel() call which contain connect of MainWindow to it's own slot.</p>
<p dir="auto">You have helped me, thank you very much!!!</p>
]]></description><link>https://forum.qt.io/post/229666</link><guid isPermaLink="true">https://forum.qt.io/post/229666</guid><dc:creator><![CDATA[andy_march]]></dc:creator><pubDate>Fri, 23 May 2014 22:38:01 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 22:29:57 GMT]]></title><description><![CDATA[<p dir="auto">The problem is that these pieces of code don't tell much. Somewhere you are connecting something at least twice. So where does that connect happen and why several times ?</p>
]]></description><link>https://forum.qt.io/post/229667</link><guid isPermaLink="true">https://forum.qt.io/post/229667</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 May 2014 22:29:57 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 22:18:20 GMT]]></title><description><![CDATA[<p dir="auto">I have class which contain next:<br />
@<br />
private slots:<br />
void loadFile();<br />
........<br />
private:<br />
GraphModel *model_;<br />
QGraphicsView *centralWidget_;<br />
........<br />
@</p>
<p dir="auto">loadFile() has next code:<br />
@<br />
if (gl(fileName, model)) {<br />
model-&gt;setParent(this);<br />
delete model_;<br />
model_ = model;<br />
centralWidget_-&gt;setScene(model_);<br />
connectModel();<br />
......<br />
@<br />
Will after it model connected two time's? So how to correctly exchange my model?</p>
]]></description><link>https://forum.qt.io/post/229665</link><guid isPermaLink="true">https://forum.qt.io/post/229665</guid><dc:creator><![CDATA[andy_march]]></dc:creator><pubDate>Fri, 23 May 2014 22:18:20 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 22:07:10 GMT]]></title><description><![CDATA[<p dir="auto">Yes exactly</p>
]]></description><link>https://forum.qt.io/post/229664</link><guid isPermaLink="true">https://forum.qt.io/post/229664</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 May 2014 22:07:10 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 22:05:44 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="SGaist" date="1400882242"]Is your slot connected twice ?[/quote]</p>
<p dir="auto">Do you mean that my slot is called twice at time in this case?</p>
]]></description><link>https://forum.qt.io/post/229663</link><guid isPermaLink="true">https://forum.qt.io/post/229663</guid><dc:creator><![CDATA[andy_march]]></dc:creator><pubDate>Fri, 23 May 2014 22:05:44 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 21:57:22 GMT]]></title><description><![CDATA[<p dir="auto">Is your slot connected twice ?</p>
]]></description><link>https://forum.qt.io/post/229662</link><guid isPermaLink="true">https://forum.qt.io/post/229662</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 May 2014 21:57:22 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 21:52:49 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="SGaist" date="1400881802"]Hi and welcome to devnet,</p>
<p dir="auto">Where is that code called from ?[/quote]</p>
<p dir="auto">This is SLOT of QMainWindow subclass.</p>
]]></description><link>https://forum.qt.io/post/229661</link><guid isPermaLink="true">https://forum.qt.io/post/229661</guid><dc:creator><![CDATA[andy_march]]></dc:creator><pubDate>Fri, 23 May 2014 21:52:49 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QFileDialog::getSaveFileName - dialog is shown more then one time by call on Fri, 23 May 2014 21:50:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Where is that code called from ?</p>
]]></description><link>https://forum.qt.io/post/229660</link><guid isPermaLink="true">https://forum.qt.io/post/229660</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 23 May 2014 21:50:02 GMT</pubDate></item></channel></rss>