Customizing Qt styles
Building a Qt style is an involved process that requires a deep understanding of Qt's widgets and painting system, and few developers will ever need to create one. We might, however, want to override some aspects of the running style to accomplish some things that aren't possible through manipulation of the palette or style sheets. We can do this by subclassing QtWidgets.QProxyStyle.
A proxy style is an overlay that we can use to override methods of the actual style that's running. In this way, it doesn't matter what actual style the user chooses, our proxy style's methods (where implemented) will be used instead.
For example, let's create a proxy style that forces all the screen text to be in uppercase, as follows: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access