<?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[Get bool result of qButton when this is pressed]]></title><description><![CDATA[<p dir="auto">Hello, i need help to obtain the boolean result in a if conditional of a button state.</p>
<p dir="auto">I have a var called <strong>restart</strong>, and i need to save a bolean value when i press the button, if is pressed i will save <strong>true</strong>, if it´s not pressed i will save false.</p>
<p dir="auto">I need that, because i'm sending in the constructor the value of <strong>restart</strong>, and i need to capture the moment when is true, becuase later when I release the button the value will be false.</p>
<p dir="auto">void MainWindow::on_btn_restart_pressed()<br />
{<br />
restart=true;<br />
myOGLW = new MyOpenGLWidget(m_sB,k_sB,b_sB,t_cB,pauser,restart,opc);<br />
}</p>
<p dir="auto">I hope that can you help whit this!!</p>
]]></description><link>https://forum.qt.io/topic/112871/get-bool-result-of-qbutton-when-this-is-pressed</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 13:17:29 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/112871.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Mar 2020 03:50:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Get bool result of qButton when this is pressed on Tue, 24 Mar 2020 04:07:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/isidro-perla">@<bdi>Isidro-Perla</bdi></a></p>
<p dir="auto">Use signals &amp; slots to send a signal to your <code>MyOpenGLWidget</code> which will cause a restart.<br />
<a href="https://doc.qt.io/qt-5/signalsandslots.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/signalsandslots.html</a></p>
<p dir="auto">Something like this (in your MainWindow)</p>
<pre><code>connect(ui-&gt;pushbutton_restart, &amp;QPushButton::clicked, myOGLW, &amp;MyOpenGLWidget::restart);
</code></pre>
<p dir="auto">Then, make your widget reset / restart itself (in <code>myOpenGLWidget</code> class)</p>
]]></description><link>https://forum.qt.io/post/584335</link><guid isPermaLink="true">https://forum.qt.io/post/584335</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Tue, 24 Mar 2020 04:07:41 GMT</pubDate></item></channel></rss>