Theme implementation overview

Widget styles are designed in KDE/Qt by utilizing one of several classes and their virtual methods that paint widgets. At the very bottom is Qt and QStyle, which provides virtual methods for drawing most Qt widgets. That is derived by KStyle, which adds some KDE specific methods. If you wish to design an unthemed style you can just derive from that. If you want to support themes you have two classes to choose from. KThemeBase adds configuration, property management, and a cache to KStyle, and KThemeStyle provides a full set of themed drawing routines. Unless if you want to provide all your own routines to paint widgets you will want to use KThemeStyle for themed styles. It is nonetheless important to be familiar with KThemeBase, as that is where all the user theme information is stored.

Here is a graphic showing the layout of the classes for KDE themeing:

Here you can see what classes you have to choose from when making a style, although in reality you will want to choose from KStyle or KThemeStyle. The basic theme plugin just makes an instance of KThemeStyle.

BTW: Do not just derive from QStyle or KDE won't load your style. Use KStyle instead.

<< Previous Page | Next Page >>

Mail Mosfet