# Set maximum module width and other layout options

**URL:** <https://discourse.slicer.org/t/set-maximum-module-width-and-other-layout-options/7853>\
**Category:** Support\
**Created:** [August 2, 2019, 7:55pm UTC](https://discourse.slicer.org/t/set-maximum-module-width-and-other-layout-options/7853 "2019-08-02T19:55:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)\
**Post date:** [August 2, 2019, 7:55pm UTC](https://discourse.slicer.org/t/set-maximum-module-width-and-other-layout-options/7853/1 "2019-08-02T19:55:11Z")

</div>

Slicer 4.10.2

I’m writing a scriptable module, and by default the width of the module is too large and it takes up too much of the screen on my laptop. Is there a way to set the overall maximum layout for the complete module, or at least the default width when the module is first initialized?

Also, where can I look up other layout options for the module (for example vertical/horizontal white spacing, centering widgets, etc) ? Thanks

---

<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 2, 2019, 8:13pm UTC](https://discourse.slicer.org/t/set-maximum-module-width-and-other-layout-options/7853/2 "2019-08-02T20:13:45Z")

</div>

There is no Slicer-specific API for size management, everything is controlled by Qt size policies that you set on your widgets.

---

<div class="post-metadata">

**Author:** ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)\
**Post date:** [August 4, 2019, 4:07pm UTC](https://discourse.slicer.org/t/set-maximum-module-width-and-other-layout-options/7853/3 "2019-08-04T16:07:01Z")

</div>

Could you point me to the Qt widget documentation? For example, how do I set white space in the slicer module, etc?

---

<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 5, 2019, 12:02am UTC](https://discourse.slicer.org/t/set-maximum-module-width-and-other-layout-options/7853/4 "2019-08-05T00:02:28Z")

</div>

See [qWidget::size Policy](https://doc.qt.io/qt-5/qwidget.html#sizePolicy-prop). White space may be added by changing margins or adding spacer widgets.
