逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::
在Qt中,直接使用QMenu::hide()是不会隐藏这个菜单的,想要隐藏菜单,因为每个菜单都是与QAction联系起来的,所以使用QMenu::menuAction()->setVisible(false),这样,就可以把这个菜单隐藏起来。

> The menu is represented in the menu bar using a QAction. In order to
> hide the menu "menuTest1" you have to hide its associated action. You
> can access that action using QMenu::menuAction(), like this:
>
> menuTest1->menuAction()->setVisible(false);

posted on 2009-09-16 22:23 逛奔的蜗牛 阅读(8091) 评论(0)  编辑 收藏 引用 所属分类: Qt

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理