Quote:
The default value of this property is Qt::DefaultContextMenu, which means the contextMenuEvent() handler is called. Other values are Qt::NoContextMenu, Qt::ActionsContextMenu, and Qt::CustomContextMenu. With Qt::CustomContextMenu, the signal customContextMenuRequested() is emitted.
So one way to popup a context menu is to override your widget's context menu event handler. The example below shows a way to show a context menu. Most probably you don't want to construct the menu each time it needs to be shown, rather construct it elsewhere and only show it here.