mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-04 09:05:30 +08:00
update
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
#include <QObject>
|
||||
#include <QtQml/qqml.h>
|
||||
#include "stdafx.h"
|
||||
#include "singleton.h"
|
||||
|
||||
class FluEvent : public QObject{
|
||||
Q_OBJECT
|
||||
@ -20,19 +21,15 @@ class FluEventBus : public QObject
|
||||
QML_NAMED_ELEMENT(FluEventBus)
|
||||
QML_SINGLETON
|
||||
private:
|
||||
static FluEventBus* m_instance;
|
||||
explicit FluEventBus(QObject *parent = nullptr);
|
||||
public:
|
||||
static FluEventBus *getInstance();
|
||||
static FluEventBus *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine)
|
||||
{
|
||||
return getInstance();
|
||||
}
|
||||
SINGLETONG(FluEventBus)
|
||||
static FluEventBus *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();}
|
||||
Q_INVOKABLE void registerEvent(FluEvent* event);
|
||||
Q_INVOKABLE void unRegisterEvent(FluEvent* event);
|
||||
Q_INVOKABLE void post(const QString& name,const QMap<QString, QVariant>& params = {});
|
||||
private:
|
||||
QList<FluEvent*> eventData;
|
||||
QList<FluEvent*> _eventData;
|
||||
};
|
||||
|
||||
#endif // FLUEVENTBUS_H
|
||||
|
Reference in New Issue
Block a user