<?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[[SOLVED] Make QWidget Child clickable]]></title><description><![CDATA[<p dir="auto">Hi, its the following way correct as to enable your own widget<br />
to be clickable like a button is. (connectable from outside)</p>
<h5>override</h5>
<p dir="auto">protected:    virtual void mouseReleaseEvent ( QMouseEvent * event );</p>
<h5>add signal</h5>
<p dir="auto">signals:   void mouseReleased();</p>
<h5>in mouseReleaseEvent</h5>
<p dir="auto">emit mouseReleased();</p>
<h5>and then in main</h5>
<pre><code>connect ( ui-&gt;NotiMachineStatus, SIGNAL ( mouseReleased() ), this, SLOT ( StatusClicked() ) )
</code></pre>
<p dir="auto">Or is there a faster way ?</p>
]]></description><link>https://forum.qt.io/topic/58910/solved-make-qwidget-child-clickable</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 06:29:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/58910.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Sep 2015 12:03:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] Make QWidget Child clickable on Wed, 16 Sep 2015 21:35:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chris-kawa">@<bdi>Chris-Kawa</bdi></a><br />
Well you kinda sold me the pushbutton idea as I need 4 of them and they all can be clicked.<br />
free signals I and assume it has paint stages so I could make a down effect.</p>
]]></description><link>https://forum.qt.io/post/290531</link><guid isPermaLink="true">https://forum.qt.io/post/290531</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 16 Sep 2015 21:35:19 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Make QWidget Child clickable on Wed, 16 Sep 2015 21:17:20 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">but I needed multiple icons and it is more of a status area widget than a button</p>
</blockquote>
<p dir="auto">How about QStatusBar with flat QPushButtons added as permanent widgets then?</p>
]]></description><link>https://forum.qt.io/post/290528</link><guid isPermaLink="true">https://forum.qt.io/post/290528</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Wed, 16 Sep 2015 21:17:20 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Make QWidget Child clickable on Wed, 16 Sep 2015 20:35:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chris-kawa">@<bdi>Chris-Kawa</bdi></a><br />
Ok. well it is actually a bit duck like,<br />
but I needed multiple icons and it is more of a status area widget<br />
than a button. But I see the quacks.</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.qt.io/post/290522</link><guid isPermaLink="true">https://forum.qt.io/post/290522</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 16 Sep 2015 20:35:34 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Make QWidget Child clickable on Wed, 16 Sep 2015 14:35:03 GMT]]></title><description><![CDATA[<p dir="auto">That seems to be ok, although if it's suppose to behave like button why not use a QPushButton or derive from it?<br />
<a href="https://en.wikipedia.org/wiki/Duck_test" target="_blank" rel="noopener noreferrer nofollow ugc">If it walks like a duck and quacks like a duck...</a>.<br />
You can <a href="http://doc.qt.io/qt-5/qpushbutton.html#flat-prop" target="_blank" rel="noopener noreferrer nofollow ugc">make it flat</a> if you don't want it to seem too conspicuous.</p>
]]></description><link>https://forum.qt.io/post/290507</link><guid isPermaLink="true">https://forum.qt.io/post/290507</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Wed, 16 Sep 2015 14:35:03 GMT</pubDate></item></channel></rss>