<?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[Link QAction availability to user selection]]></title><description><![CDATA[<p dir="auto">Hello everyone,</p>
<p dir="auto">I've created some QActions into QMenus, I'd like to disable them if no selection is done in my main widget.<br />
How can I do it ?</p>
<p dir="auto">I'm aware of the QAction-&gt;setEnabled() method, but how can I link it to the user mouse selection ?</p>
]]></description><link>https://forum.qt.io/topic/83862/link-qaction-availability-to-user-selection</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 07:34:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/83862.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Oct 2017 07:54:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Link QAction availability to user selection on Sun, 08 Oct 2017 17:38:38 GMT]]></title><description><![CDATA[<p dir="auto">Because it's a <a href="http://doc.qt.io/qt-5/qtableview.html#selectionChanged" target="_blank" rel="noopener noreferrer nofollow ugc">signal of QTableView</a>.</p>
]]></description><link>https://forum.qt.io/post/419460</link><guid isPermaLink="true">https://forum.qt.io/post/419460</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 08 Oct 2017 17:38:38 GMT</pubDate></item><item><title><![CDATA[Reply to Link QAction availability to user selection on Sun, 08 Oct 2017 16:42:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a>  I tried this, but the selectionChanged signal doesn't exist in the QAction class.</p>
<pre><code>    connect(callAct, &amp;QItemSelectionModel::selectionChanged, ipWidget, &amp;IpWidget::onSelectionChanged);

</code></pre>
]]></description><link>https://forum.qt.io/post/419451</link><guid isPermaLink="true">https://forum.qt.io/post/419451</guid><dc:creator><![CDATA[theo_ld]]></dc:creator><pubDate>Sun, 08 Oct 2017 16:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to Link QAction availability to user selection on Thu, 05 Oct 2017 10:17:12 GMT]]></title><description><![CDATA[<p dir="auto">I try that, thanks for you advice !</p>
]]></description><link>https://forum.qt.io/post/418922</link><guid isPermaLink="true">https://forum.qt.io/post/418922</guid><dc:creator><![CDATA[theo_ld]]></dc:creator><pubDate>Thu, 05 Oct 2017 10:17:12 GMT</pubDate></item><item><title><![CDATA[Reply to Link QAction availability to user selection on Thu, 05 Oct 2017 07:53:40 GMT]]></title><description><![CDATA[<p dir="auto">Then add a slot to the class that manages these actions and connect it to the <a href="http://doc.qt.io/qt-5/qitemselectionmodel.html#selectionChanged" target="_blank" rel="noopener noreferrer nofollow ugc">selectionChanged signal</a> of your selection model. In there check whether the selection is empty and update the action state accordingly.</p>
]]></description><link>https://forum.qt.io/post/418903</link><guid isPermaLink="true">https://forum.qt.io/post/418903</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 05 Oct 2017 07:53:40 GMT</pubDate></item><item><title><![CDATA[Reply to Link QAction availability to user selection on Thu, 05 Oct 2017 07:12:55 GMT]]></title><description><![CDATA[<p dir="auto">It's a user left-click selection of a <code>QItemSelectionModel </code> on a <code>QTableView</code>. The user data is stored into a <code>QTableModel</code>.</p>
]]></description><link>https://forum.qt.io/post/418896</link><guid isPermaLink="true">https://forum.qt.io/post/418896</guid><dc:creator><![CDATA[theo_ld]]></dc:creator><pubDate>Thu, 05 Oct 2017 07:12:55 GMT</pubDate></item><item><title><![CDATA[Reply to Link QAction availability to user selection on Wed, 04 Oct 2017 21:54:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">What kind of selection are you referring to ?</p>
]]></description><link>https://forum.qt.io/post/418863</link><guid isPermaLink="true">https://forum.qt.io/post/418863</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 04 Oct 2017 21:54:49 GMT</pubDate></item></channel></rss>