<?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[TreeView - Context menu]]></title><description><![CDATA[<p dir="auto">I'm using Qt 5.1.1's Desktop controls.  I need to be able to do a context menu on a selected row in the TableView.</p>
<p dir="auto">I looked into "clicked" and "activated" signals but they don't provide which mouse button was pressed.  Any ideas?</p>
<p dir="auto">Thanks<br />
-Atif</p>
]]></description><link>https://forum.qt.io/topic/31893/treeview-context-menu</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 21:19:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/31893.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Sep 2013 18:21:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TreeView - Context menu on Mon, 23 Sep 2013 14:54:54 GMT]]></title><description><![CDATA[<p dir="auto">Your title is a bit misleading as it refers to TableView.</p>
<p dir="auto">There are two ways to achieve this:</p>
<p dir="auto">@    TableView {<br />
id: table<br />
anchors.fill: parent<br />
model: 100<br />
TableViewColumn { title: "First" }<br />
MouseArea {<br />
id: mouse<br />
acceptedButtons: Qt.RightButton<br />
anchors.fill: parent<br />
onClicked: menu.popup()<br />
Menu { id: menu ; MenuItem { text: "Popup at row " + table.rowAt(mouse.mouseX, mouse.mouseY) } }<br />
}<br />
}<br />
@<br />
Alternatively you can set a custom itemDelegate and place the menu in there.</p>
]]></description><link>https://forum.qt.io/post/196408</link><guid isPermaLink="true">https://forum.qt.io/post/196408</guid><dc:creator><![CDATA[Jens]]></dc:creator><pubDate>Mon, 23 Sep 2013 14:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to TreeView - Context menu on Sat, 21 Sep 2013 19:33:18 GMT]]></title><description><![CDATA[<p dir="auto">First Create Actions in you application UI. Then for your TreeView Widget, use <em>setContextMenuPolicy(Qt::ActionsContextMenu);</em> In your constructor, assign those actions to your Widget with <em>ui-&gt;tableWidget-&gt;addAction(ui-&gt;actionNew);</em></p>
]]></description><link>https://forum.qt.io/post/196225</link><guid isPermaLink="true">https://forum.qt.io/post/196225</guid><dc:creator><![CDATA[blueshift]]></dc:creator><pubDate>Sat, 21 Sep 2013 19:33:18 GMT</pubDate></item></channel></rss>