The object.addAction variants with multiple arguments have changed
signature in Qt 6. It's safer to explicitly create a QAction first
and then add to an object using:
my_action=QAction(...)
obj.addAction(my_action)
It's a considerably less fragile syntax to use in any case!
Fixes errors when trying to show context menu in Python console
on Qt 6 builds