Technology Sharing

Qt article - Let the child component ignore the parent component's style sheet

2024-07-06

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

For example: There is a QGroupBox parent component, and the style QGroupBox{......} is added to the layout. It has a child component QGroupBox, which will also inherit the style of the parent component.

In fact, after adding a style to the parent component in the layout, there is no way to directly let the child component ignore the style of the parent component, but you can add it when adding a style to the parent component.