mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-14 21:57:08 +00:00
28 lines
799 B
C
28 lines
799 B
C
|
#pragma once
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <functional>
|
||
|
|
||
|
class DynamicQObjectFactory;
|
||
|
|
||
|
class DynamicQObject2 : public QObject
|
||
|
{
|
||
|
public:
|
||
|
using OnSlotExecuted = std::function<QVariant(int, const QString&, const std::vector<QVariant>&)>;
|
||
|
|
||
|
DynamicQObject2(const DynamicQObjectFactory* factory,
|
||
|
OnSlotExecuted handler);
|
||
|
|
||
|
void emitSignal(const QString& name, const std::vector<QVariant>& arguments);
|
||
|
const QMetaObject* metaObject() const override;
|
||
|
int qt_metacall(QMetaObject::Call callType, int index, void**args) override;
|
||
|
|
||
|
private:
|
||
|
bool executeSlot(int index, void** args);
|
||
|
bool readProperty(int index, void** args);
|
||
|
bool writeProperty(int index, void** args);
|
||
|
|
||
|
const DynamicQObjectFactory* const m_factory;
|
||
|
const OnSlotExecuted m_handler;
|
||
|
};
|