PDA

View Full Version : Using Stylesheet to Customize QSpinBox



talyn
15th June 2015, 21:34
Hi All,

I'm trying to customize some of the spin boxes in a dialog I'm making, but setting the stylesheet seems to completely override the stylesheet for the widget.

I'm using the following stylesheet to try to set the width of the widget and the width of the up/down buttons, but the spin box seems to lose the border and icons completely. I've applied my new stylesheet to the top boxes, but not the bottom ones, so you can see how the modified ones differ from the default.

Stylesheet: "QSpinBox { width: 60; } QSpinBox::up-button { width: 10; } "

Result:
11212

My question is: Is it possible to only set the width of the widget and buttons in the stylesheet and have the rest use the QSpinBox's defaults, or am I going to need to specify a full stylesheet with all the default values? If I do need to specify a full stylesheet, where can I get one that contains all the default values so I can modify it?

Thanks,
~talyn

momolegamer
4th October 2019, 01:49
There is some example of QSpinBox stylesheet here : https://qss-stock.devsecstudio.com