<?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[MessageBox closing Error ?]]></title><description><![CDATA[<p dir="auto">I wrote this code , and i'm pressing the back button on the messagebox doesn't close the mesagebox but shows the messagebox again. A second click closes the messagebox.</p>
<p dir="auto">QMessageBox msg(this);<br />
msg.setWindowFlags( Qt::Window | Qt::FramelessWindowHint);<br />
msg.setStyleSheet("font: 75 20pt Liberation Serif ;");<br />
QPixmap p("/home/pi/git/Updates/UI/img/Shield.png");<br />
auto newPixmap = p.scaled(80, 80);<br />
msg.setIconPixmap(newPixmap);<br />
QFont font;<br />
font.setBold(true);<br />
msg.setFont(font);<br />
msg.setText(" Quality Check - 405 nm \n\n Run Distilled Water");<br />
msg.setStandardButtons(QMessageBox::Ok |  QMessageBox::Cancel);<br />
msg.setButtonText(QMessageBox::Ok , "Run");<br />
msg.setButtonText(QMessageBox::Cancel , "Back");<br />
msg.setFixedWidth(500);<br />
if(msg.exec() == QMessageBox::Ok)<br />
{<br />
ui-&gt;stackedWidget-&gt;setCurrentIndex(1);<br />
}<br />
else<br />
{<br />
ui-&gt;stackedWidget-&gt;setCurrentIndex(1);<br />
}</p>
<p dir="auto">The messagebox should be closed on the first click.<br />
how to write it?</p>
]]></description><link>https://forum.qt.io/topic/139517/messagebox-closing-error</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 08:47:52 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139517.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Sep 2022 09:36:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MessageBox closing Error ? on Fri, 23 Sep 2022 09:53:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> Ok Thank you.</p>
]]></description><link>https://forum.qt.io/post/729920</link><guid isPermaLink="true">https://forum.qt.io/post/729920</guid><dc:creator><![CDATA[Ramkumar Mohan]]></dc:creator><pubDate>Fri, 23 Sep 2022 09:53:06 GMT</pubDate></item><item><title><![CDATA[Reply to MessageBox closing Error ? on Fri, 23 Sep 2022 09:49:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ramkumar-mohan">@<bdi>Ramkumar-Mohan</bdi></a><br />
Please learn to put blocks of code inside <strong>Code</strong> tags to make it easier for others to read, thank you.</p>
<p dir="auto">Use a debugger/<code>qDebug()</code> statements to verify it returns on first click and follows the <code>else</code> route in your code.  Assuming so, what happens after that?</p>
]]></description><link>https://forum.qt.io/post/729917</link><guid isPermaLink="true">https://forum.qt.io/post/729917</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 23 Sep 2022 09:49:50 GMT</pubDate></item></channel></rss>