Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.12.10, 5.14.2, 5.15.2
-
None
-
-
96adebed6 (dev), 168f4aee2 (6.8)
Description
I discovered this issue when upgrading a Qt project from 5.2.1 to 5.14.
When setting a stylesheet, in my case the background-color property, the height of the widget is decreased when 1px. Removing the stylesheet again resizes the widget to it's original size.
Even if the stylesheet is invalid e.g. widget->setStyleSheet("blulb") causes this issue.
I tried to bypass this issue by supplying the actual height. However that didn't worked it seems that the supplied height is used for the underlying qlineedit widget. So setting an height of 24px triggers a total widget height of 30px which is imo also a bit weird.
I finally temporary resolved this by extending the QDoubleSpinBox widget and add an alternative setstylesheet method that appends the qlineedit height to the stylesheet.
Btw, this issue didn't exist in 5.2.1 it might be because the stylesheet was only applied on the underlying qlinedit, just saying.
Attachments
Issue Links
- is duplicated by
-
QTBUG-130642 Incorrect QAbstractSpinBox size hint in Windows 11 style when style sheet is set
-
- Closed
-