bool MyClass::eventFilter(QObject *obj, QEvent *evt)
{
if (evt->type() == QEvent::Paint)
{
obj->removeEventFilter(this);
QApplication::sendEvent(obj, evt);
obj->installEventFilter(this)
// наша отрисовка поверх уже нарисованного
return true;
}
}
$ ./Debug+Asserts/bin/clang -fsyntax-only /tmp/zzz.cc
/tmp/zzz.cc:7:33: warning: operator '?:' has lower precedence than '<<'; '<<' will be evaluated first [-Wparentheses]
cout << (sizeof(char *) == 8) ? "64-bit" : "32-bit";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/tmp/zzz.cc:7:33: note: place parentheses around the '<<' expression to silence this warning
cout << (sizeof(char *) == 8) ? "64-bit" : "32-bit";
^
( )
/tmp/zzz.cc:7:33: note: place parentheses around the '?:' expression to evaluate it first
cout << (sizeof(char *) == 8) ? "64-bit" : "32-bit";
^
( )
/tmp/zzz.cc:7:35: warning: expression result unused [-Wunused-value]
cout << (sizeof(char *) == 8) ? "64-bit" : "32-bit";
^~~~~~~~
2 warnings generated.