-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
6.9
Scenario
- Style sheet with a general clause for QLabel and another clause for QLabel depending on accessibleName
- When placing QLabel widgets inside a QGridLayout within a QScrollArea (accessibleName set accordingly) the clause depending on accessibleName does not take effect (it does work in very peculiar circumstances, like setting window flags on the top level or parenting)
Steps to Reproduce
- Build and run the attached example project qtbug137551_2.zip.
- It shows the Form.ui (accessibleName setting) embedded into several top level using various methods. Note the clause for QLabel depending on accessibleName works only in a few cases.
- Compare with a similar QLabel placed outside the scroll area that does apply the style correctly.
Actual
All QLabel widgets, whether inside or outside a QScrollArea, should apply the stylesheet consistently.
Expected
Labels inside the scroll area do not reflect the applied style, unlike those outside.
Workaround:
The only way to force the style to apply inside the scroll area is to:
- Not set a parent on the QLabel
- Set the Qt::Window flag on the label
This workaround is not ideal and breaks normal widget hierarchy and layout.