I am using Qt5 on Windows7 platform:
Qt Creator version is: v3.3.2.
Qt version 5.5.1 and MinGW 32bit.
Currently, in the menu bar I have:
Configuration - Reports - Help
I searched SO and I found this as a possible answer: Not possible to hide a QMenu object QMenu::setVisible()?, but it didn't work...
So, I was trying to remove the Help menu using:
ui->menuHelp->setVisible(false);
and:
ui->menuHelp->menuAction()->setVisible(false);
Unfortunatelly, both failed to hide/remove the Help
menu...
Please, is there any other way to do it?
[Code]:
MainWindow::MainWindow(QWidget * parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowMaximizeButtonHint);
if(!server.listen(QHostAddress("192.168.1.2"), 8001))
return;
if(true) // just testing...
ui->menuHelp->menuAction()->setVisible(false);
}
ui->menu3->menuAction()->setVisible(false);
and it work like expected - hidesmenu3
. Your promblem is somewhere else. – EvgenysetVisible(false)
from within theMainWindow
's constructor or where exactly?... What am I doing wrong? – סטנלי גרונןui->menuHelp->setVisible(false);
? It compiles ok as a matter of fact, but it doesn't hide anything :) – סטנלי גרונן