<?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[Help with QButtonBox]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm new to Qt.</p>
<p dir="auto">I have a QDialog with a QButtonBox that has a Save, Cancel and Open buttons.  I've read the documentation for the QButtonBox, but I just can't figure out how to manage the buttons events.  I know I can manage the accepted() and cancelled() events, but since Open and Save buttons are both 'accepting' I don't know where to put the code for each one of them.  Any pointers?</p>
<p dir="auto">I've been searching but I just can't find any answers to this problem.  I'm stuck and I would very much appreciate your help.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.qt.io/topic/24742/help-with-qbuttonbox</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 11:07:57 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/24742.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 01 Mar 2013 13:09:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help with QButtonBox on Sat, 02 Mar 2013 17:15:39 GMT]]></title><description><![CDATA[<p dir="auto"><em>_dialogButtonBox</em> was giving me an error because it's not the name of my instance and took me a while to find out that the right code for me:<br />
@QDialogButtonBox::StandardButton stdButton = ui-&gt;buttonBox-&gt;standardButton(button);@<br />
As I told you, I'm new to Qt.  But now I got it running.  Thank you very much SGaist!</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nikoko">@<bdi>Nikoko</bdi></a>: Thanks for your suggestion.  I think I get what you mean, but SGaist's solution is exactly what I was looking for.</p>
]]></description><link>https://forum.qt.io/post/168986</link><guid isPermaLink="true">https://forum.qt.io/post/168986</guid><dc:creator><![CDATA[ningu]]></dc:creator><pubDate>Sat, 02 Mar 2013 17:15:39 GMT</pubDate></item><item><title><![CDATA[Reply to Help with QButtonBox on Fri, 01 Mar 2013 17:03:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You can use the "clicked signal":<a href="http://qt-project.org/doc/qt-4.8/qdialogbuttonbox.html#clicked" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/qdialogbuttonbox.html#clicked</a> signal from QDialogButtonBox:<br />
@<br />
void xxxx::onClickedButtonSignal(QAbstractButton * button)<br />
{<br />
QDialogButtonBox::StandardButton stdButton = _dialogButtonBox.standardButton(button);<br />
switch (stdButton) {<br />
case QDialogButtonBox::Ok:<br />
...<br />
break;<br />
// etc...<br />
}<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/168910</link><guid isPermaLink="true">https://forum.qt.io/post/168910</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 01 Mar 2013 17:03:12 GMT</pubDate></item><item><title><![CDATA[Reply to Help with QButtonBox on Fri, 01 Mar 2013 15:50:16 GMT]]></title><description><![CDATA[<p dir="auto">Use sender () function which return which object send the signal.<br />
Example :<br />
@<br />
void xxxx:mySlot ()<br />
{<br />
QPushButton * pb = dynamic_cast &lt;QPushButton *&gt;( sender ());</p>
<p dir="auto">if (pb == buttonOk)<br />
...<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/168904</link><guid isPermaLink="true">https://forum.qt.io/post/168904</guid><dc:creator><![CDATA[nikoko]]></dc:creator><pubDate>Fri, 01 Mar 2013 15:50:16 GMT</pubDate></item><item><title><![CDATA[Reply to Help with QButtonBox on Fri, 01 Mar 2013 15:45:02 GMT]]></title><description><![CDATA[<p dir="auto">Thanks.  I tried that, but I had problems figuring out how to know what button sent the signal.  I finally found button-&gt;text() to be the closest hit, but I'm not sure if that's the best way to do it.  Is there a better (correct) way to find out about the sender?</p>
]]></description><link>https://forum.qt.io/post/168902</link><guid isPermaLink="true">https://forum.qt.io/post/168902</guid><dc:creator><![CDATA[ningu]]></dc:creator><pubDate>Fri, 01 Mar 2013 15:45:02 GMT</pubDate></item><item><title><![CDATA[Reply to Help with QButtonBox on Fri, 01 Mar 2013 15:26:11 GMT]]></title><description><![CDATA[<p dir="auto">You can use the signal :<br />
void clicked ( QAbstractButton * button )<br />
to know what button you activate by clicking</p>
]]></description><link>https://forum.qt.io/post/168901</link><guid isPermaLink="true">https://forum.qt.io/post/168901</guid><dc:creator><![CDATA[nikoko]]></dc:creator><pubDate>Fri, 01 Mar 2013 15:26:11 GMT</pubDate></item></channel></rss>