<?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[QDialog to QDialog communication]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I want info to be passed from one QDialog to another. Should this be handled by signal/slot or is there another mechanism to handle the task?</p>
]]></description><link>https://forum.qt.io/topic/70373/qdialog-to-qdialog-communication</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 16:09:55 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/70373.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Aug 2016 23:15:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QDialog to QDialog communication on Sat, 20 Aug 2016 07:20:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/whatif">@<bdi>WhatIf</bdi></a><br />
Hi<br />
close dont call delete (unless flag set) so that is why it works.<br />
the "this" is still valid and we block at  infoDialog.exec() so<br />
its not deleted behind our back.</p>
<p dir="auto">When i read your question i assumed you would  have dialogs open at the same time. hence signal would be the best. But it more like in sequence i see</p>
<p dir="auto">it could be a bit cleaner if you can let mainwindow handle it and we then get rid of "one dialog open the other one" as its best to avoid if possible.<br />
Its not wrong as such but not optimal as Qt::WA_DeleteOnClose can crash the<br />
code.</p>
<p dir="auto">what about something like ?</p>
<pre><code>void mainwindow::Search() {
  SeachDia SD;
  InformationDialog infoDialog () ;
  if ( SD.exec() == Accepted) {
    Information* info = SD.retrieveInfo();
    infoDialog.setSearchData(info);
    infoDialog.exec();
  }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/343286</link><guid isPermaLink="true">https://forum.qt.io/post/343286</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 20 Aug 2016 07:20:30 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog to QDialog communication on Fri, 19 Aug 2016 23:29:03 GMT]]></title><description><![CDATA[<p dir="auto">When I set the Qt::WA_DeleteOnClose flag, the program crashes when I click cancel in the 2nd dialog, which calls close().</p>
<p dir="auto">Also, it the order of</p>
<pre><code>emit on_Info_Changed(Information);
infoDialog.exec();
</code></pre>
<p dir="auto">correct?</p>
]]></description><link>https://forum.qt.io/post/343276</link><guid isPermaLink="true">https://forum.qt.io/post/343276</guid><dc:creator><![CDATA[WhatIf]]></dc:creator><pubDate>Fri, 19 Aug 2016 23:29:03 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog to QDialog communication on Fri, 19 Aug 2016 21:20:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/whatif">@<bdi>WhatIf</bdi></a> said:</p>
<blockquote>
<p dir="auto">close</p>
</blockquote>
<p dir="auto">Perhaps because the first dialog is closed but not deleted from memory?<br />
You could set the Qt::WA_DeleteOnClose flag and see if it still works.</p>
]]></description><link>https://forum.qt.io/post/343263</link><guid isPermaLink="true">https://forum.qt.io/post/343263</guid><dc:creator><![CDATA[Jan-Willem]]></dc:creator><pubDate>Fri, 19 Aug 2016 21:20:26 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog to QDialog communication on Fri, 19 Aug 2016 20:11:36 GMT]]></title><description><![CDATA[<p dir="auto">Just need a clarification</p>
<pre><code>        close();
        Information* info = retrieveInfo();
        InformationDialog infoDialog;
        infoDialog.setModal(true);
        connect(this, SIGNAL(InfoChanged(Information*)), &amp;infoDialog, SLOT(on_Info_Changed(Information*)));
        emit on_Info_Changed(Information);
        infoDialog.exec();
</code></pre>
<p dir="auto">basically I want the first dialog to search for information and then close and display the information on the 2nd dialog. The above code works but I just don't get how "this" in connect() still exists after the call to close();</p>
<p dir="auto">Will this code cause problems?</p>
]]></description><link>https://forum.qt.io/post/343253</link><guid isPermaLink="true">https://forum.qt.io/post/343253</guid><dc:creator><![CDATA[WhatIf]]></dc:creator><pubDate>Fri, 19 Aug 2016 20:11:36 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog to QDialog communication on Fri, 19 Aug 2016 05:49:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
While you can use plain functions, signals &amp; slots are far Superior as you hide the details<br />
from rest of the program.</p>
<p dir="auto">So you simple define a set of signals and slot that defines what they want to "say" to each other<br />
and then hook it up.</p>
]]></description><link>https://forum.qt.io/post/343117</link><guid isPermaLink="true">https://forum.qt.io/post/343117</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 19 Aug 2016 05:49:42 GMT</pubDate></item></channel></rss>