문제

By default when creating a new Qt Widget project using Qt Creator. There's a menu bar, and it is shown always even without any menus, sub menus or actions. I don't want to delete this menu bar in designer view, just want to hide it only. Any solution?

도움이 되었습니까?

해결책

try

ui->menuBar->hide(); // hide menubar
ui->menuBar->show(); // in case you want to restore it

in your mainwindow class if you want to hide it in the runtime.

Otherwise, you don't have to create a project with mainwindow.ui everytime. As you start a new project, there's an option in [Details]->[Base class] which allows you to choose the base class (template form) as mainwindow, dialog or widget.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top