# How to get the eye visibility checkbox widget in my module

**URL:** https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648
**Category:** Development
**Tags:** python
**Created:** [October 11, 2022, 7:44pm UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648 "2022-10-11T19:44:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://discourse.slicer.org/u/Niels)
#### Post date: [October 11, 2022, 7:44pm UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648/1 "2022-10-11T19:44:09Z")

</div>

I like the checkboxes that are used for showing and hiding.For example the one in the Volume Rendering module or to show/hide segments in the segment editor.

I know how to add an ordinary checkbox widget in my module using Python.

But how to make it into this eye-icon like checkbox?

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [October 13, 2022, 12:59pm UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648/2 "2022-10-13T12:59:18Z")

</div>

You need to set the icons

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/e/ce1c71ffea278fb1e28d798139f0a65cf67433a9.png)

---

<div class="post-metadata">

### Author: ![jmhuie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jmhuie/32/7086_2.png) [@jmhuie](https://discourse.slicer.org/u/jmhuie)
#### Post date: [January 22, 2023, 4:59pm UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648/3 "2023-01-22T16:59:48Z")

</div>

Sorry, how do I actually set the icon? It looks like I need to select it from a file or resource, but I’m not sure what’s the easiest way to access that.

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [January 23, 2023, 9:54am UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648/4 "2023-01-23T09:54:40Z")

</div>

You start Qt Designer as described in the documentation. Then you click on the little arrow next to the icon (see screenshot above), then select `Choose Resource...`. You can then import the resource file `path\to\Slicer\Libs\MRML\Widgets\Resources\qMRMLWidgets.qrc`. You’ll then see the icons in the resource list.

---

<div class="post-metadata">

### Author: ![jmhuie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jmhuie/32/7086_2.png) [@jmhuie](https://discourse.slicer.org/u/jmhuie)
#### Post date: [January 23, 2023, 2:08pm UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648/5 "2023-01-23T14:08:53Z")

</div>

> [@cpinter](#):
>
> You can then import the resource file `path\to\Slicer\Libs\MRML\Widgets\Resources\qMRMLWidgets.qrc`.

I am trying to add the resource file, but I am unable to navigate to it or add that path. I am also unable to find the file on my Mac within the Slicer application.

 ![Screen Shot 2023-01-23 at 9.02.12 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/4/b496d1fdf3ab30f6faae5a9edf9d9f5176643db0.jpeg)

---

<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: [January 26, 2023, 11:20pm UTC](https://discourse.slicer.org/t/how-to-get-the-eye-visibility-checkbox-widget-in-my-module/25648/6 "2023-01-26T23:20:30Z")

</div>

It might be simpler to set the icon in the sou Ce code as it is done here:

> <https://github.com/vmtk/SlicerExtension-VMTK/blob/094b64a090c5433ed20b00c8980a6361bd682860/CrossSectionAnalysis/CrossSectionAnalysis.py#L91>
