控件.setContextMenuPolicy(Qt.ContextMenuPolicy.XXX);
Qt.ContextMenuPolicy可选的有5种,就用过两种
1-ActionsContextMenu 把窗口的Action直接添加进去
the widget displays its QWidget::actions() as context menu.
2-CustomContextMenu
the widget emits the QWidget::customContextMenuRequested() signal.
3-DefaultContextMenu 默认的。比如文本框出来复制粘贴之类的
the widget's QWidget::contextMenuEvent() handler is called.
4-NoContextMenu
the widget does not feature a context menu, context menu handling is deferred to the widget's parent.
5-PreventContextMenu
the widget does not feature a context menu, and in contrast to NoContextMenu, the handling is not deferred to the widget's parent.