QMenu 禁用/隐藏

(直接设置菜单禁用是无效的,要把菜单转换为一个控制按钮的模式来操作)
QAction *QMenu::menuAction() const
Returns the action associated with this menu.
(返回与此菜单关联的操作)
例子:
m_Menu->menuAction()->setEnabled(flase);//禁用该菜单
m_Menu->menuAction()->setVisible(false);//隐藏该菜单

你可能感兴趣的:(QT,qt,音视频,ui)