Does anybody have experience with custom styled, custom widgets in QT? (I am using Qt 4.5)
The problems looks like this:
I want to develop some custom controls that are not based entirely on existing drawing primitives and sub-controls. Since the entire application should be skinnable, I want to rely on custom styles, possible on style sheets as well.
What I need to configure for those new controls are the following:
- additional metrics
- additional palette entries
- additional style options
Digging on internet and documentation, I found out that I need to derive a new style class from one the QStyle sub-classes, and override polish method for adding new palette entries, and drawControl (and the other draw methods) for painting logic for custom control and custom parts.
I have two issues that bother me:
Currently, there are different style classes for different styles, already implemented in QT. (e.g. QMotifStyle, QWindowsStyle), each with different settings. Through inheritance, I would need to reimplement the painting and additional setup logic for each style, in order to properly integrate in all these styles. Do I have another alternative?
I am still confused about how can style sheets be used with these custom styles. Can anybody point to a place where I can find more information than the one provided by QT documentation? (The samples in QT don't help me too much).