QSpinBox behaves strangely when padding is set
-
in QtDesigner, I am styling a QSpinBox with just simply padding: 5px, but this happens when cursor enters or leaves the QSpinBox:

I hope you can see that gray kind of padding surrounding it (since I can't post an .avif which shows better the flickering). I tried manipulating the values exactly as well as demonstrated in qt documentation like this:QSpinBox { font-size: 18px; border-width: 1px; padding: 5px; } QSpinBox::up-button { subcontrol-origin: border; subcontrol-position: top right; /* position at the top right corner */ width: 4px; /* 4 + 2*1px border-width = 5px padding + 1px parent border */ border-width: 1px; } QSpinBox::down-button { subcontrol-origin: border; subcontrol-position: bottom right; /* position at the top right corner */ width: 4px; /* 4 + 2*1px border-width = 5px padding + 1px parent border */ border-width: 1px; }but this completly hides the up and down buttons and so is the border of QSpinBox and couldn't find any similar issue out there.
-
What style do you use and did you enable scaling for your monitor?
-
I don't know what you mean by style but for monitor scaling even though I changed it to 100% still the same effect
-
I don't know what you mean by style but for monitor scaling even though I changed it to 100% still the same effect
@rida_zouga said in QSpinBox behaves strangely when padding is set:
don't know what you mean by style
Style: https://doc.qt.io/qt-6/qapplication.html#setStyle
What OS do you use? -
using windows 10, and for style not using anything at all, so default for windows 10 I suppose
-
So it's the windowsvista style. I can reproduce it but no idea how to fix it. You might create a bug report -> bugreports.qt.io