In my case, this was happening with a QFrame. Here is the solution if anyone ever needs it:
rgbFrame
::rgbFrame(QWidget * parent, Qt
::WindowFlags f
): QFrame(parent, f
){
installEventFilter(this);
}
{
QFrame::paintEvent(e
);
// pass event to base class }
{
if (e
->type
() == QEvent::Paint) { }
return QFrame::eventFilter(o, e
);
}
rgbFrame::rgbFrame(QWidget * parent, Qt::WindowFlags f): QFrame(parent, f)
{
installEventFilter(this);
}
void rgbFrame::paintEvent(QPaintEvent *e)
{
QFrame::paintEvent(e); // pass event to base class
}
bool rgbFrame::eventFilter(QObject *o, QEvent *e)
{
if (e->type() == QEvent::Paint) {
paintEvent((QPaintEvent *)e);
}
return QFrame::eventFilter(o, e);
}
To copy to clipboard, switch view to plain text mode
Bookmarks