identify a trigger of QAction
<p>below I quoted my code. The problem is easy to describe. selectedItem->text  is not the right way to differ what action was selected in the menu. How to do it right? </p>

<pre><code>void RView::ShowContextMenu(const QPoint&amp; pos) // this is a slot
{
// for most widgets
QPoint globalPos = statusWidget-&gt;mapToGlobal(pos);
// for QAbstractScrollArea and derived classes you would use:
// QPoint globalPos = myWidget-&gt;viewport()-&gt;mapToGlobal(pos);

QMenu myMenu;
myMenu.addAction("first");
myMenu.addAction("second");

QAction* selectedItem = myMenu.exec(globalPos);
if (selectedItem)
{ 
    if(selectedItem-&gt;text == "first")
     // do something 
    if(selectedItem-&gt;text == "second")
     // do other stuff
}
else
{
    // nothing was chosen
}
}
</code></pre>