|
|
@ -20,6 +20,8 @@ |
|
|
|
#ifndef INTERFACE_H |
|
|
|
#ifndef INTERFACE_H |
|
|
|
#define INTERFACE_H |
|
|
|
#define INTERFACE_H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <QMetaObject> |
|
|
|
|
|
|
|
|
|
|
|
#include <functional> |
|
|
|
#include <functional> |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -48,7 +50,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#define DECLARE_SIGNAL(name, ...) \ |
|
|
|
#define DECLARE_SIGNAL(name, ...) \ |
|
|
|
using Slot_##name = std::function<void (__VA_ARGS__)>; \ |
|
|
|
using Slot_##name = std::function<void (__VA_ARGS__)>; \ |
|
|
|
virtual void connectTo_##name(Slot_##name slot) const = 0 |
|
|
|
virtual QMetaObject::Connection connectTo_##name(Slot_##name slot) const = 0 |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @def DECLARE_SIGNAL |
|
|
|
* @def DECLARE_SIGNAL |
|
|
@ -56,7 +58,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#define DECLARE_SIGNAL(name, ...) \ |
|
|
|
#define DECLARE_SIGNAL(name, ...) \ |
|
|
|
using Slot_##name = std::function<void (__VA_ARGS__)>; \ |
|
|
|
using Slot_##name = std::function<void (__VA_ARGS__)>; \ |
|
|
|
virtual void connectTo_##name(Slot_##name slot) const = 0 |
|
|
|
virtual QMetaObject::Connection connectTo_##name(Slot_##name slot) const = 0 |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @def SIGNAL_IMPL |
|
|
|
* @def SIGNAL_IMPL |
|
|
@ -65,7 +67,7 @@ |
|
|
|
#define SIGNAL_IMPL(classname, name, ...) \ |
|
|
|
#define SIGNAL_IMPL(classname, name, ...) \ |
|
|
|
using Slot_##name = std::function<void (__VA_ARGS__)>; \ |
|
|
|
using Slot_##name = std::function<void (__VA_ARGS__)>; \ |
|
|
|
Q_SIGNAL void name(__VA_ARGS__); \ |
|
|
|
Q_SIGNAL void name(__VA_ARGS__); \ |
|
|
|
void connectTo_##name(Slot_##name slot) const override { \ |
|
|
|
QMetaObject::Connection connectTo_##name(Slot_##name slot) const override { \ |
|
|
|
connect(this, &classname::name, slot); \ |
|
|
|
connect(this, &classname::name, slot); \ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|