#pragma once #include #include class Event; class Object; class EventLoop { public: virtual ~EventLoop(); int exec(); virtual void waitForEvent() = 0; void postEvent(Object* receiver, OwnPtr&&); static EventLoop& main(); protected: EventLoop(); private: struct QueuedEvent { Object* receiver { nullptr }; OwnPtr event; }; Vector m_queuedEvents; };