calling paintEvent() of the super class
Hi!
So I have overridden paintEvent() of a QFrame and I can paint what I want, but now I can do ONLY what I want. Things like background color, borders and corners are missing. Don't I have to somehow call super.paintEvent() first? How do I do that?
Thanks
Cruz
Re: calling paintEvent() of the super class
did you try something like this?
Code:
{
//then you can draw what you need
....
}
Re: calling paintEvent() of the super class
Quote:
Originally Posted by
Cruz
Hi!
So I have overridden paintEvent() of a QFrame and I can paint what I want, but now I can do ONLY what I want. Things like background color, borders and corners are missing. Don't I have to somehow call super.paintEvent() first? How do I do that?
Thanks
Cruz
You have to draw the primitive element and then you draw what you want.
Code:
opt.init(this);
style
()->drawPrimitive
(QStyle::PE_Widget,
&opt,
&painter,
this);