开发者

Hiding a QWidget on a QToolbar?

I have directly added some QWidgets to a QToolbar but simply going widget->setVisible(false) did not work. Can someone please give me an example of how to show and hide a widge开发者_高级运维t that is on a QToolbar?

Thanks!


You need to call setVisible() on the appropriate QAction instead. For example, addWidget() returns a QAction*:

QAction* widgetAction = toolBar->addWidget(someWidget);
widgetAction->setVisible(false);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜