I have created a custom event in my Qt application by subclassing QEvent.
class MyEvent : public QEvent { public: MyEvent() : QEvent((QEvent::Type)20
If the event-type identifies your specific class, i'd put it there:
class MyEvent : public QEvent { public: static const QEvent::Type myType = static_cast(2000); // ... }; // usage: if(evt->type() == MyEvent::myType) { // ... }