Hi to all!!!
i want to know how can i remove widget from QToolbar!!!
ex: ToolBar->addWidget(ComboBox);
i want to remove this ComboBox without using clear function?
please help me!!!
Thanks to all of you !!!![]()
Hi to all!!!
i want to know how can i remove widget from QToolbar!!!
ex: ToolBar->addWidget(ComboBox);
i want to remove this ComboBox without using clear function?
please help me!!!
Thanks to all of you !!!![]()
Haven't tried it but QWidget::removeAction() with the QAction pointer returned when you added the widget looks promising.
If you simply want to hide the combobox, you may use QAction::setVisible
From the docs -
QAction * QToolBar::addWidget ( QWidget * widget )
Adds the given widget to the toolbar as the toolbar's last item.
The toolbar takes ownership of widget.
If you add a QToolButton with this method, the tools bar's Qt::ToolButtonStyle will not be respected.
Note: You should use QAction::setVisible() to change the visibility of the widget. Using QWidget::setVisible(), QWidget::show() and QWidget::hide() does not work.
Bookmarks