C++ (Qt)bool MyApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents){ if (event->type() == myClearAll) { postedEvents->clear(); return true; } return QGuiApplication::compressEvent(event, receiver, postedEvents);}