How to Hide Specific Toolbars in Custom AppSlicer Build (Markups, Sequence Browser, etc.)

Hi everyone,

I’ve created a custom NewAppSlicer build using Kitware’s 3D Slicer source. Everything is working great, but I’m running into a UI customization issue.

From the View > Toolbars menu, I want to permanently hide some specific toolbars in my custom build:

  • Mouse Interaction
  • Capture/Restore
  • Crosshair Selection
  • Extensions
  • Markups
  • Sequence Browser
    I’ve tried hiding them in qNewSlicerAppMainWindowPrivate::setupUi() using the following:
    this->MouseModeToolBar->setVisible(false);
    this->CaptureToolBar->setVisible(false);
    this->ViewToolBar->setVisible(false);
    // … and others
    Despite no build errors, after compiling and running the app, these toolbars still appear in the toolbar list and show up in the UI.

What I’ve Tried:

  • Verified the toolbar object names (e.g., MouseModeToolBar, CaptureToolBar)
  • Added setVisible(false) calls
  • Rebuilt from scratch and cleared CMake cache

What I Need Help With:

  • The correct internal object names for toolbars like Markups, Extensions, and Sequence Browser
  • Whether hiding them in setupUi() is the right approach
  • Any other reliable way to remove/hide these toolbars by default so users don’t see or re-enable them

I’d really appreciate any tips or code examples from someone who has customized the Slicer UI at this level.

Thanks in advance!