In a QDockWidget
derived class I enable style sheet support as follows:
void CDockWidget::paintEvent(QPaintEvent *event)
{
QStyleOption opt;
opt.initFrom(this);
QPainter p(this);
this->style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
// call QDockWidget::paintEvent(event) here ???????
// I have called QDockWidget::paintEvent(event) here, but did not notice any difference
}
Question: Do I have to call the parent class paintEvent
or is this wrong (if so please elaborate). In the original code example the parent function is NOT called, but I wonder if this is correct? It would miss any functionality there, wouldn't it?
Remark: The above code allows to use style sheets with derived classes as described in: Qt stylesheet in derived class in C++ namespace (selector)