# Loadable module questions: \`setBuiltIn()\` and set module active

**URL:** <https://discourse.slicer.org/t/loadable-module-questions-setbuiltin-and-set-module-active/19203>\
**Category:** Development\
**Created:** [August 15, 2021, 5:09pm UTC](https://discourse.slicer.org/t/loadable-module-questions-setbuiltin-and-set-module-active/19203 "2021-08-15T17:09:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [August 15, 2021, 5:09pm UTC](https://discourse.slicer.org/t/loadable-module-questions-setbuiltin-and-set-module-active/19203/1 "2021-08-15T17:09:02Z")

</div>

Hi,

I’m becoming familiar with creating loadable modules.

I write some module and I think it should be built in. I can see that there is a method `setBuiltIn()` that is provided by `qSlicerLoadableModule`. I tried to:

```cpp
qSlicerStackLoadModule::qSlicerStackLoadModule(QObject* _parent)
  : Superclass(_parent)
  , d_ptr(new qSlicerStackLoadModulePrivate)
{
  setBuiltIn(true);
}

```

but can’t understand what that brings up. What `setBuiltIn(true)` changes?

Also how to programmatically set some module active? i.e. display my module in Slicer app’s module tab via C++ when some signal is emited.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 16, 2021, 5:34am UTC](https://discourse.slicer.org/t/loadable-module-questions-setbuiltin-and-set-module-active/19203/2 "2021-08-16T05:34:32Z")

</div>

The built-in property is set when the module is loaded, [based on its location in the install tree](https://github.com/Slicer/Slicer/blob/0094e9a35bd266cc8b0e677858dabce797c9928f/Base/Logic/vtkSlicerApplicationLogic.cxx#L780-L819). The value is not expected to change, therefore if you change it then it will be ignored at most places, but the inconsistency between the initial and current value may cause some issues. If you want to add a “built-in” module then you need to add it to Slicer in your [custom application](https://blog.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/) and not install it as an extension. Modules that are in extensions bundled with the custom application probably show up as built-in, too.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 16, 2021, 2:49pm UTC](https://discourse.slicer.org/t/loadable-module-questions-setbuiltin-and-set-module-active/19203/3 "2021-08-16T14:49:27Z")

</div>

2 posts were split to a new topic: [How to initialize module widget at application startup](https://discourse.slicer.org/t/how-to-initialize-module-widget-at-application-startup/19211)
