How does your code relate to a QTableWidget?
Is MyWindow a QTableWidget subclass?
How are you calling showContextMenu()?

Cheers,
_