Palette not properly applied when customized in editor
-
Hello I just started to fiddle with color palettes and stylesheets using the "Fusion" style and came across some problems.
When changing the palette of my MainWindow it seems that items of a combobox are not affected. However, when loading the same palette in code then the palette does get applied to them.
When applying a stylesheet to my MainWindow or centralwidget with the following content, the Pushbutton is styled correctly but it also affects the styles of different other elements like text of labels, slider colors. It seems they are resettet to the default color style.
QPushButton:checked { background-color: rgb(61, 182, 66); }
Loading the palette in code fixes this again. Am i missing something here? Also what is the general workflow in Qt when styling and customizing widgets?
-
Hello I just started to fiddle with color palettes and stylesheets using the "Fusion" style and came across some problems.
When changing the palette of my MainWindow it seems that items of a combobox are not affected. However, when loading the same palette in code then the palette does get applied to them.
When applying a stylesheet to my MainWindow or centralwidget with the following content, the Pushbutton is styled correctly but it also affects the styles of different other elements like text of labels, slider colors. It seems they are resettet to the default color style.
QPushButton:checked { background-color: rgb(61, 182, 66); }
Loading the palette in code fixes this again. Am i missing something here? Also what is the general workflow in Qt when styling and customizing widgets?
@ian28
Customizing palettes of widgets is one way, setting style sheets is another. Mixing both approaches can result in resetting palettes to default brushes/colors, when a style sheet is applied after palettes were customized. The exact behavior, however, depends on your widget hierarchy. You'd have to post more code to analyze that in detail.