PDA

View Full Version : Custom style - drawControl event not called for top level windows



lumiss
9th June 2011, 07:48
Hello,

well, the title says it all. I am writing a custom style which inherits QCommonStyle, and I noticed that drawControl() is called for all widgets on the form, but not for the form itself.

I realize I can use form's paintEvent, but then it wouldn't be part of the style. Any idea how can I draw something on a top level window from within the style class?

Thanks,

Nik

joyer83
9th June 2011, 09:36
What is this 'form', is it some Qt's class or your own? Of what is it inherited from?

wysota
9th June 2011, 11:20
Subclasses of QWidget should draw the QStyle::PE_Widget element using QStyle::drawPrimitive() so you can implement your additional stuff there.