Custom QStyle's methods are not called except for QStyle::polish
Hello,
I'm developing a custom style and have a little problem. I've created a class (let's call it RStyle) inherited from QWindowsStyle with the following methods implemented:
Code:
public:
public slots:
I also added some tracing in the begging of each method (output to stdout). Tracing showed that only polish (both overloaded methods) is called when creating a widget, other methods are not called (so only widget's palette is altered according to the style).
Any ideas why?
Custom style is set with QApplication::setStyle(new RStyle()) after the QApplication object is constructed.
RStyle itself is declared and implemented in dynamic library.
P.S. I'm using Qt 4.6 (2009.05), QtCreator 1.3, Windows XP SP3 (with Classic theme (Win98-style)).
Re: Custom QStyle's methods are not called except for QStyle::polish
The problem is solved; apparently 'const' qualifier is included in method signature thus can be used to overload methods and must be specified to override method (if the same method in parent class has it). :o
Re: Custom QStyle's methods are not called except for QStyle::polish
I also encountered a similar problem, but the solution was a slightly different scope specifier in one of the arguments. I discovered that, this doesn't work
but this does:
Code:
QIcon standardIconImplementation
(StandardPixmap standardIcon,
const QStyleOption* option
= 0,