这个模式利用了回调函数技术。
command.h
#pragma once
#include <QDebug>
class CCommand
{
public:
virtual void execute() = 0;
};
class CReceiver
{
public:
void action()
{
qDebug() << "action fact!";
}
};
class ConCreateCommand : public CCommand
{
public:
ConCreateCommand(CReceiver *rev):m_rev(rev){}
~ConCreateCommand(){delete m_rev;}
void exec