Answer the question
In order to leave comments, you need to log in
Why doesn't QToolBar::addWidget() work?
I create a new Qt Designer form class, throw a couple of buttons on the form so that it is, define its instance in the main window class:
MyToolbarWidget *myToolBarWidget; // MyToolBarWidget наследуется от QWidget
QAction *myToolBarWidgetAction; // может манипуляции через setVisible() помогут? (спойлер: нет)
myToolBarWidget = new MyToolBarWidget(ui->toolBar);
myToolBarWidgetAction = ui->toolBar->addWidget(myToolBarWidget);
myToolBarWidgetAction->setVisible(true);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question