Hi,
How can I avoid this line when adding QToolBar into mainwindow?
seems that there contains 2 tool bar?
toolBar->setGeometry(0,0,200,20);
this->addToolBar(toolBar);
QToolBar* toolBar = new QToolBar(this);
toolBar->setGeometry(0,0,200,20);
this->addToolBar(toolBar);
To copy to clipboard, switch view to plain text mode
error.png
Added after 1 31 minutes:
It seems that when one QMainWindow is created,
there is already one default ToolBar inside of it.
<QToolBar*> bars = this->findChildren<QToolBar*>();
I get one tool bar element without calling addToolBar function...
But somehow I dont find similar functions like QMainWindow::menuBar() or QMainWindow::statusBar()...
Bookmarks