How to create a custom context menu for Qtableview
-
I tried setting context menu policy to action context menu but no context menu is displayed on right click
-
I tried setting context menu policy to
custom context menu but no context
menu is displayed on right click -
I merged these two threads, because I think you're asking the same question, perhaps?
-
If you set the contextMenuPolicy to ActionsMenuContext make sure you've actually set some QActions for the widget.
If you set the contextMenuPolicy to CustomContextMenu make sure you've connected to the customContextMenuRequested signal. You will have to show the context menu manually there.
2/4