Important: Please read the Qt Code of Conduct -

[SOLVED] Hiding File Menu from browser demo

  • I've tried removing the File menu from the Browser demo that comes with qt-everywhere-opensource-src-4.6.4 however every time I do something or another crashes, this is obviously because the handles aren't there any more when something attempts to hook into it.

    Is there a sure fire way to remove this menu and the toolbar without messing everything else up?

  • Moderators

    When you say "removing", what are you removing? And more importantly, what are you leaving?

  • Just stopping it from displaying really, I removed @setupMenu()@ from @browsermainwindow.cpp@ so I assume something else is relying on using the handles @setupMenu()@ creates.

  • Moderators

    You should still create the menu, but call menuBar()->setVisible(false) to hide it if you'd like. You can add that line any time after setupMenu() is called (or at the end of that method, itself.)

  • Perfect! I completely forgot to check out the default settings since they control the layout as well. Thank you!

  • Moderators

    Great! Be sure and label the title as [Solved]. Thanks!

Log in to reply