MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / post

Method post

ElaWidgetTools/ElaEventBus.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51ElaEventBusType::EventBusReturnType ElaEventBus::post(const QString& eventName, const QVariantMap& data)
52{
53 Q_D(ElaEventBus);
54 if (eventName.isEmpty())
55 {
56 return ElaEventBusType::EventBusReturnType::EventNameInvalid;
57 }
58 if (d->_eventMap.contains(eventName))
59 {
60 QList<ElaEvent*> eventList = d->_eventMap.value(eventName);
61 foreach (auto event, eventList)
62 {
63 if (event->parent())
64 {
65 QMetaObject::invokeMethod(event->parent(), event->getFunctionName().toLocal8Bit().constData(), event->getConnectionType(), Q_ARG(QVariantMap, data));
66 }
67 }
68 }
69 return ElaEventBusType::EventBusReturnType::Success;
70}
71
72QStringList ElaEventBus::getRegisteredEventsName() const
73{

Callers 1

takeOverNativeEventMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected