process context menu action in qt
<p>I manually added the following menu to my QTableWidget.</p>

<p>Here is what I have:</p>

<p><a href="https://i.stack.imgur.com/D1So2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D1So2.png" alt="enter image description here"></a></p>

<p>Part of the code was setup using Qt Designer and I'm modifying it slightly in my code. </p>

<p>Here is the code that I've added to have a context menu:</p>

<pre><code>self.group1RegistersTableWidget.addAction(self.actionReadRegister)
self.group1RegistersTableWidget.addAction(self.actionWriteRegister)
self.actionSeparator.setSeparator(True)
self.actionSeparator.setText("")
self.group1RegistersTableWidget.addAction(self.actionSeparator)
self.group1RegistersTableWidget.addAction(self.actionBinRegisterFormat)
self.group1RegistersTableWidget.addAction(self.actionDecRegisterFormat)
self.group1RegistersTableWidget.addAction(self.actionHexRegisterFormat)

self.group2RegistersTableWidget.addAction(self.actionReadRegister)
self.group2RegistersTableWidget.addAction(self.actionWriteRegister)
</code></pre>

<p>and here is the code that I used</p>

<p>I'm somewhat new to Qt. How do I process these actions. How do I know that Read/Write/Binary/Decimal/Hexadecimal has been clicked. As far as I understand I need to connect some signal to some slot, but I can't figure out which ones. Would someone be able to help me out. I'm using <code>PyQt4</code>, but C++ code would also be fine.</p>

<p>Any help is appreciated.</p>