Hi, why not
QAction * QToolBar::addWidget ( QWidget * widget ) I had used it to embed QComboBox in toolbar and it worked fine.
This method is meant exactly for such cases!
This one is important:Adds the given widget to the toolbar as the toolbar's last item.
If you add a QToolButton with this method, the tools bar's Qt::ToolButtonStyle will not be respected.
So, insert your combobox directly without any layouts and additional widgets.Note: You should use QAction::setVisible() to change the visibility of the widget. Using QWidget::setVisible(), QWidget::show() and QWidget::hide() does not work.
and try with combobox created withoud any parant,
addWidget () should deal with everything(reparenting, layout etc.) by itself, so simply do not disturb it.
works fine in my app.Qt Code:
theQuickFinder = new ElQuickFinder(); theFindToolBar->addWidget(theQuickFinder);To copy to clipboard, switch view to plain text mode
You can read also about related
QWidget * QToolBar::widgetForAction ( QAction * action ) constmethod.
Bookmarks