开发者

How to Remove a widget from a QToolBar?

I'm building my App interface with Qt at the moment. But one question arises... I have a QToolbar to which I added a QToolButton with the QToolbar->addWidget method. The problem is that I want to remove this button later on.

How can I achieve that ?

There is an addWidget method but nothing like a removeWidget correspondence...

Any idea开发者_如何学Python ?

Thanks a lot in advance for your help.

Miky Mike


You have to use removeAction. Like this:

QAction* MyAction = MyToolBar -> addWidget (MyWidget) ;
...
MyToolBar -> removeAction (MyAction) ;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜