
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.
opt.init(this);
style
()->drawPrimitive
(QStyle::PE_Widget,
&opt,
&painter,
this);
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
To copy to clipboard, switch view to plain text mode
Bookmarks