PDA

View Full Version : How to remove default toolbar?



TorAn
4th December 2010, 23:45
I am using QMainWindow and upon initialization I am adding two toolbars on my own. The result is shown in the attached screenshot.

My question is: how to remove default toolbar? I did not find any method that does that.

tbscope
5th December 2010, 05:40
http://doc.qt.nokia.com/4.7/qmainwindow.html#removeToolBar

TorAn
5th December 2010, 12:21
I apologize for not mentioning the fact that prior to posting my question I read QMainWindow documentation. All QMainWindow methods to remove toolbar require the pointer to the toolbar as argument. I did not find method to get the pointer to the default toolbar.

So, I can restate the question this way: how to get the pointer to the default toolbar in QMainWindow?

tbscope
5th December 2010, 12:36
ui->mainToolBar
Unless you changed the name.

Lykurg
5th December 2010, 12:50
...or remove the toolbar in your ui file. In the designer right click -> remove!