Reputation: 341
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 ?
Thanks a lot in advance for your help.
Miky Mike
Upvotes: 3
Views: 6042
Reputation: 17114
You have to use removeAction
. Like this:
QAction* MyAction = MyToolBar -> addWidget (MyWidget) ;
...
MyToolBar -> removeAction (MyAction) ;
Upvotes: 7