Closed leon-thomm closed 3 years ago
Hi @leon-thomm
I don't remember what was the real reason to work with classes instead of elements, but looking at your example I think that must be an error on my first test windows. I just removed all class selectors and replaced them with elements selectors, the .QWidget
were replaced with explicit selectors like: QToolBox > QWidget
and QTabWidget > QWidget
.
Thanks a lot.
Yep, I think that works now, thanks for the quick fix!
Possible that you forgot QLineEdit? still the same there
Hi @leon-thomm
With .QLineEdit
the style is applied to only explicit QLineEdit
widgets and not to editable items like in QListView
.
I will remove .QLineEdit
and configure as unset
all subwidgets.
Thanks.
Ah, I understand the initial issues now. But this also means that no custom subclasses of QLineEdit will be styled, right? Which I guess isn't what one wants usually, no? Wouldn't it be more sustainable to add specific styling rules for things like QListView
items?
The default style for editable widgets looks pretty good, is simple and functional.
Hey! I'm not entirely sure what writing
.QSlider
in the qss would mean, but it produces a bug, so I suggest changing it.If you specify the style sheet properties for a slider using
.QSlider
, to at runtime added sliders it only applies if they are part of a widget that gets added (even though theQSlider
is aQWidget
, the style isn't applied at all when added at runtime to an existing layout). This only applies on custom implementations of QSlider, inserting plain QSliders seems to work. This code reproduces that:Just click somewhere into the window. I figured it works when manually applying the template stylesheet and literally just removing the dots of
.QSlider
. I noticed there are many of these.somwidget
specifications in the template stylesheet, so this might apply on other widgets as well, so it'd be nice if you could take a closer look at that. I'm on Windows 10 with Python 3.8 in case that matters.