Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15, 6.7, 6.8
Description
Even though it's not a real QProxyStyle, the private QStyleSheetStyle almost behaves as such, and also actually has a baseStyle() getter like QProxyStyle does; unfortunately, it's not really public (at least not from Python).
Since the QSS style may alter some aspects but not others, and being aware about that could be useful in subclasses, it may be relevant to know the underlying style in some cases. For instance, the QSS style may only change some palette roles or the font (therefore the WA_StyleSheetTarget may not be a sufficient hint), possibly only for one of its pseudo states or even just for its subcontrols.
Being able to retrieve the base style is quite relevant, as it can be used as a reference comparison with the QSS/base style functions, or even decide if/how/when alter the behavior of subclassed overrides based on the QSS or the base style behavior.
I suggest to make baseStyle() a virtual for QStyle (defaulting to itself), with QProxyStyle behaving as before, so that QStyleSheetStyle can properly return its base style as well.