<?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]: QMenu hide&#x2F;show actions.]]></title><description><![CDATA[<p dir="auto">I'm not sure if this is the right place for feature requests, so if there's somewhere else that I should put it let me know.</p>
<p dir="auto">It would be very helpful to be able to hide and show actions in QMenus. For example, I am making a tool that modifies files from an old game. The 3D models can "reference" another model and use its vertex data instead of providing it's own (there are many models that have the same vertices). I have a context menu that appears when you right click on a model name in the list of models. If the model references another then the menu has an action called "Dereference" which gives the model it's own vertex data. If it is not referencing another model it has an action called "Make reference" where it searches through the list of models for a model that has the same vertices. Only one of these two actions is visible at a time.</p>
<p dir="auto">I could accomplish this through the insertAction and removeAction functions, but this requires that I keep track of what the previous state was. It would be much easier if I could simply hide and show which ones I need. I also don't want to just disable one or the other, as that is less intuitive since they accomplish similar goals.</p>
]]></description><link>https://forum.qt.io/topic/14651/solved-qmenu-hide-show-actions</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 01:16:57 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/14651.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Mar 2012 02:12:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED]: QMenu hide&#x2F;show actions. on Sun, 04 Jan 2015 18:11:13 GMT]]></title><description><![CDATA[<p dir="auto">I found this while searching how to hide a QMenu itself, you do this with:</p>
<p dir="auto">@menu-&gt;menuAction()-&gt;setVisible(false)@</p>
]]></description><link>https://forum.qt.io/post/151760</link><guid isPermaLink="true">https://forum.qt.io/post/151760</guid><dc:creator><![CDATA[mr.exodia]]></dc:creator><pubDate>Sun, 04 Jan 2015 18:11:13 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]: QMenu hide&#x2F;show actions. on Sun, 04 Jan 2015 18:11:13 GMT]]></title><description><![CDATA[<p dir="auto">I found this while searching how to hide a QMenu itself, you do this with:</p>
<p dir="auto">@menu-&gt;menuAction()-&gt;setVisible(false)@</p>
]]></description><link>https://forum.qt.io/post/256176</link><guid isPermaLink="true">https://forum.qt.io/post/256176</guid><dc:creator><![CDATA[mr.exodia]]></dc:creator><pubDate>Sun, 04 Jan 2015 18:11:13 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]: QMenu hide&#x2F;show actions. on Mon, 05 Mar 2012 11:21:37 GMT]]></title><description><![CDATA[<p dir="auto">Why yes they do, that would definitely do it. I guess this is a case of just not knowing what to look for in the API. Consider this problem solved!</p>
]]></description><link>https://forum.qt.io/post/131413</link><guid isPermaLink="true">https://forum.qt.io/post/131413</guid><dc:creator><![CDATA[someone972]]></dc:creator><pubDate>Mon, 05 Mar 2012 11:21:37 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED]: QMenu hide&#x2F;show actions. on Mon, 05 Mar 2012 06:12:41 GMT]]></title><description><![CDATA[<p dir="auto"><em>QActions</em> do have a <em>visible</em> property, don't they?</p>
]]></description><link>https://forum.qt.io/post/131378</link><guid isPermaLink="true">https://forum.qt.io/post/131378</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 05 Mar 2012 06:12:41 GMT</pubDate></item></channel></rss>