<p>I am trying to set the background color for a double spin box, and I am not sure what function I should use.</p>

<p>I saw some function called <code>SetBackgroundRole</code> which accepts a <code>Qt::ColorRole</code>, but I am not sure how to use this one as well.</p>

<p>Kindly let me know, what's the simple way to change the background color of a <code>QComboBox</code> or <code>QDoubleSpinBox</code>?</p>

I'd try something like
```
```
QPalette pal = widget.palette();
pal.setColor(QPalette::Window, Qt::blue);
widget.setPalette(pal);
```
```