# XML style for custom layout

**URL:** https://discourse.slicer.org/t/xml-style-for-custom-layout/5831
**Category:** Support
**Created:** [February 19, 2019, 4:10pm UTC](https://discourse.slicer.org/t/xml-style-for-custom-layout/5831 "2019-02-19T16:10:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [February 19, 2019, 11:19pm UTC](https://discourse.slicer.org/t/xml-style-for-custom-layout/5831/2 "2019-02-19T23:19:10Z")

</div>

For regular Qt layouts, you change change background color of a widget using xml or python

```xml
<property name="styleSheet">
 <string>background-color:#000000</string>
</property>

```

```python
widget=qt.QWidget()
widget.setStyleSheet("background-color:#000000") # background set to black

```

I generally use Qt Designer to generate UI files which is the XML code. That application is actually bundled in Slicer 4.10.1 which you can access by going to …/Slicer 4.10.1/bin/SlicerDesigner.exe or you can use it if you download Qt5 from the web.

Slicer does technically have a “Dark Mode” if you are attempting to set layouts to some dark color. You can switch to it by going to Edit-\>Application Settings-\>Appearance-\>Style-\>Dark Slicer

---

_[View the full topic](https://discourse.slicer.org/t/xml-style-for-custom-layout/5831)._
