You mean
If you subclass from QWidget, you need to provide a paintEvent for your custom QWidget as below:
@void CustomWidget::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}@
The above code is a no-operation if there is no stylesheet set.
Warning: Make sure you define the Q_OBJECT macro for your custom widget.
Yes, thanks - that works.
But i wonder, to have to do such overhead. Why isn't it implemented in QWidget itself?