<?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[QMessageBox won&#x27;t close using setStandardButtons(0);]]></title><description><![CDATA[<p dir="auto">All,<br />
I launch a standard QMessageBox using:<br />
@<br />
dialogBox = new QMessageBox( this );<br />
dialogBox-&gt;setAttribute( Qt::WA_DeleteOnClose ); //makes sure the msgbox is deleted automatically when closed<br />
dialogBox-&gt;setText("Device rebooting");<br />
dialogBox-&gt;setInformativeText("Please wait for device to reboot.");<br />
dialogBox-&gt;setStandardButtons(0);</p>
<pre><code>    dialogBox-&gt;open( this, NULL);
</code></pre>
<p dir="auto">@</p>
<p dir="auto">but if I call:<br />
@<br />
dialogBox-&gt;close();<br />
@</p>
<p dir="auto">Nothing happens, and the MessageBox will not close. However, If I include a standard button:<br />
@msgBox-&gt;setStandardButtons(QMessageBox::Cancel); @</p>
<p dir="auto">It will close just fine with:<br />
@dialogBox-&gt;close();@</p>
<p dir="auto">Any Ideas?</p>
<p dir="auto">Thanks,<br />
Terry</p>
]]></description><link>https://forum.qt.io/topic/50785/qmessagebox-won-t-close-using-setstandardbuttons-0</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 15:42:01 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/50785.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Feb 2015 17:28:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QMessageBox won&#x27;t close using setStandardButtons(0); on Mon, 02 Feb 2015 21:25:41 GMT]]></title><description><![CDATA[<p dir="auto">You're welcome !</p>
<p dir="auto">Since you have your message box 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/260139</link><guid isPermaLink="true">https://forum.qt.io/post/260139</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 02 Feb 2015 21:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to QMessageBox won&#x27;t close using setStandardButtons(0); on Mon, 02 Feb 2015 17:37:25 GMT]]></title><description><![CDATA[<p dir="auto">Done(0) works great!!</p>
<p dir="auto">Thanks!<br />
Terry</p>
]]></description><link>https://forum.qt.io/post/260124</link><guid isPermaLink="true">https://forum.qt.io/post/260124</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 02 Feb 2015 17:37:25 GMT</pubDate></item><item><title><![CDATA[Reply to QMessageBox won&#x27;t close using setStandardButtons(0); on Mon, 02 Feb 2015 17:34:16 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Can you try with done(0) ?</p>
]]></description><link>https://forum.qt.io/post/260123</link><guid isPermaLink="true">https://forum.qt.io/post/260123</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 02 Feb 2015 17:34:16 GMT</pubDate></item></channel></rss>