#ifndef WIDGETSEVENTSERVICE_H #define WIDGETSEVENTSERVICE_H #include #include #include #include #include #include #include class WidgetsEventService : public QObject, public IEventService { Q_OBJECT Q_INTERFACES(IEventService) QTMVVM_INJECT_PROP(EchoService*, echoService, _echoService) public: Q_INVOKABLE explicit WidgetsEventService(QObject *parent = nullptr); explicit WidgetsEventService(EchoService* svc, QObject *parent = nullptr); int addEvent(const QString &name) override; void removeEvent(int eventId) override; Q_SIGNALS: void eventTriggered(const QString &event) final; private: int _cnt; QHash> _events; EchoService* _echoService; Q_INVOKABLE void qtmvvm_init(); }; #endif // WIDGETSEVENTSERVICE_H