DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DA::DACommandsForWorkFlowRemoveSelectNodes类 参考

The 节点删除命令 更多...

#include <DACommandsForWorkFlowNodeGraphics.h>

类 DA::DACommandsForWorkFlowRemoveSelectNodes 继承关系图:

Public 成员函数

 DACommandsForWorkFlowRemoveSelectNodes (DANodeGraphicsScene *scene, QUndoCommand *parent=nullptr)
 
void redo ()
 
void undo ()
 
void classifyItems (DANodeGraphicsScene *scene, QList< DAAbstractNodeGraphicsItem * > &nodeItems, QList< DAAbstractNodeLinkGraphicsItem * > &linkItems, QList< QGraphicsItem * > &normalItem)
 把选中的item分类
 
bool isValid () const
 
int removeCount () const
 获取移除的数量,此函数构造后即可调用
 
QList< DAAbstractNodeGraphicsItem * > getRemovedNodeItems () const
 获取选择的节点,此函数构造后即可调用
 
QList< DAAbstractNodeLinkGraphicsItem * > getRemovedNodeLinkItems () const
 获取移除的link,此函数构造后即可调用
 
QList< QGraphicsItem * > getAllRemovedItems () const
 获取所有移除的QGraphicsItem
 

静态 Public 成员函数

static QList< DAAbstractNodeLinkGraphicsItem * > getNodesLinks (const QList< DAAbstractNodeGraphicsItem * > &nodeItems)
 

详细描述

The 节点删除命令

注解
此命令不会合并

构造及析构函数说明

◆ DACommandsForWorkFlowRemoveSelectNodes()

DA::DACommandsForWorkFlowRemoveSelectNodes::DACommandsForWorkFlowRemoveSelectNodes ( DANodeGraphicsScene scene,
QUndoCommand *  parent = nullptr 
)

针对在命令的构造函数中就直接执行了创建或者删除动作的情况, 创建的命令mNeedDelete初始要为true,否则创建此命令,但没推入stack就会出现内存泄露 反之亦然,删除的命令,needdelete应该为false

成员函数说明

◆ classifyItems()

void DA::DACommandsForWorkFlowRemoveSelectNodes::classifyItems ( DANodeGraphicsScene scene,
QList< DAAbstractNodeGraphicsItem * > &  nodeItems,
QList< DAAbstractNodeLinkGraphicsItem * > &  linkItems,
QList< QGraphicsItem * > &  normalItem 
)

把选中的item分类

参数
scene
nodeItems
linkItems

◆ getAllRemovedItems()

QList< QGraphicsItem * > DA::DACommandsForWorkFlowRemoveSelectNodes::getAllRemovedItems ( ) const

获取所有移除的QGraphicsItem

返回

◆ getRemovedNodeItems()

QList< DAAbstractNodeGraphicsItem * > DA::DACommandsForWorkFlowRemoveSelectNodes::getRemovedNodeItems ( ) const

获取选择的节点,此函数构造后即可调用

返回

◆ getRemovedNodeLinkItems()

QList< DAAbstractNodeLinkGraphicsItem * > DA::DACommandsForWorkFlowRemoveSelectNodes::getRemovedNodeLinkItems ( ) const

获取移除的link,此函数构造后即可调用

返回

◆ redo()

void DA::DACommandsForWorkFlowRemoveSelectNodes::redo ( )

这里要把node保存下来,node是智能指针,如果用户正常操作添加,addNode_,node的智能指针是有其它地方的实例不会析构 但是,如果是打开工程,打开后再删除,这样ndoe是没有其它地方的实例,如果这里直接removeNode,节点就会被析构, 因此,为了避免node析构,这里要把node再保存下来

◆ removeCount()

int DA::DACommandsForWorkFlowRemoveSelectNodes::removeCount ( ) const

获取移除的数量,此函数构造后即可调用

返回

该类的文档由以下文件生成: