feat: 添加ElaWidgetTool库

This commit is contained in:
sleepwithoutbz
2025-09-19 22:40:52 +08:00
parent 5f93e8caf6
commit 4eef5c7fd5
407 changed files with 36325 additions and 7 deletions

View File

@@ -0,0 +1,45 @@
#ifndef ELAEVENTBUS_H
#define ELAEVENTBUS_H
#include <QObject>
#include <QVariantMap>
#include "ElaDef.h"
#include "ElaProperty.h"
#include "ElaSingleton.h"
class ElaEventPrivate;
class ELA_EXPORT ElaEvent : public QObject
{
Q_OBJECT
Q_Q_CREATE(ElaEvent)
Q_PROPERTY_CREATE_Q_H(QString, EventName);
Q_PROPERTY_CREATE_Q_H(QString, FunctionName);
Q_PROPERTY_CREATE_Q_H(Qt::ConnectionType, ConnectionType);
public:
explicit ElaEvent(QObject* parent = nullptr);
explicit ElaEvent(QString eventName, QString functionName, QObject* parent = nullptr);
~ElaEvent() override;
ElaEventBusType::EventBusReturnType registerAndInit();
};
class ElaEventBusPrivate;
class ELA_EXPORT ElaEventBus : public QObject
{
Q_OBJECT
Q_Q_CREATE(ElaEventBus)
Q_SINGLETON_CREATE_H(ElaEventBus);
private:
explicit ElaEventBus(QObject* parent = nullptr);
~ElaEventBus() override;
public:
ElaEventBusType::EventBusReturnType post(const QString& eventName, const QVariantMap& data = {});
QStringList getRegisteredEventsName() const;
private:
friend class ElaEvent;
};
#endif // ELAEVENTBUS_H