# Cannot hide tool bars and module panel

**URL:** <https://discourse.slicer.org/t/cannot-hide-tool-bars-and-module-panel/24913>\
**Category:** Development\
**Created:** [August 25, 2022, 7:14am UTC](https://discourse.slicer.org/t/cannot-hide-tool-bars-and-module-panel/24913 "2022-08-25T07:14:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nnzzll](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nnzzll/32/16350_2.png) [@nnzzll](https://discourse.slicer.org/u/nnzzll)\
**Post date:** [August 25, 2022, 7:14am UTC](https://discourse.slicer.org/t/cannot-hide-tool-bars-and-module-panel/24913/1 "2022-08-25T07:14:09Z")

</div>

I am developing a custom app and want to hide slicer’s tool bars and module panel.  
Inside the `qXXAppMainWindowPrivate::setupUi` function , I added several lines at the bottom

```auto
  auto modulePanel = mainWindow->findChildren<QDockWidget*>();
  auto toolbars = mainWindow->findChildren<QToolBar*>();
  modulePanel.at(0)->setVisible(false);
  for(int i=0;i<toolbars.count();i++)
  {
    toolbars.at(i)->setVisible(false);
  }

```

which should hide the module panel and toolbars, however,  
Every time I start the app the module panel and toolbars still exists.

What is the problem during startup? Since python api like `setToolbarsVisible` works fine with this.

Operating system: ubuntu 18.04  
Slicer version: v5.0.3
