#pragma once class QUndoCommand; #include "ZxPolicy.h" /// 策略:删除图件 class I_PLOTBASE_EXPORT ZxDeletePolicy : public ZxPolicy { Q_OBJECT public: ZxDeletePolicy(); public slots: /// 菜单和键盘都挂接到此slot, 它负责调用onConfirm()和onDeleteItem(). 一般无需重载 virtual void slotDeleteItem(); protected: /// 生成命令、压栈, 并清除policy防止再次进入. 重载此函数可做特殊处理 virtual void onDeleteItem(); /// 键盘处理, 默认只响应DEL键, 一般无需重载. virtual void onKeyPress(QKeyEvent* event); };