|
|
| DAWorkFlowGraphicsScene (QObject *parent=0) |
| |
| void | setPreDefineSceneAction (SceneActionFlag mf) |
| | 设置鼠标动作
|
| |
| void | setBackgroundPixmapItem (DAGraphicsPixmapItem *item) |
| | 设置背景item,如果外部调用getBackgroundPixmapItem并删除,需要通过此函数把保存的item设置为null
|
| |
| DAGraphicsPixmapItem * | removeBackgroundPixmapItem () |
| | 移出当前的背景item
|
| |
| void | enableItemMoveWithBackground (bool on) |
| | 允许item跟随背景图移动
|
| |
| void | setEnableItemLinkageMove (bool on) |
| | 允许移动图元时,其它和此图元链接起来的图元跟随移动
|
| |
|
bool | isEnableItemLinkageMove () const |
| |
| bool | isEnableItemMoveWithBackground () const |
| | DAWorkFlowGraphicsScene::isEnableItemMoveWithBackground
|
| |
| DAGraphicsPixmapItem * | setBackgroundPixmap (const QPixmap &pixmap) |
| | 添加一个背景图,如果多次调用,此函数返回的QGraphicsPixmapItem* 是一样的,也就是只会创建一个QGraphicsPixmapItem*
|
| |
| DAGraphicsPixmapItem * | getBackgroundPixmapItem () const |
| | 获取背景图item
|
| |
|
QFont | getDefaultTextFont () const |
| |
|
void | setDefaultTextFont (const QFont &f) |
| |
|
QColor | getDefaultTextColor () const |
| |
|
void | setDefaultTextColor (const QColor &c) |
| |
|
| DANodeGraphicsScene (QObject *p=nullptr) |
| | DANodeGraphicsScene
|
| |
|
| DANodeGraphicsScene (const QRectF &sceneRect, QObject *p=nullptr) |
| |
|
| DANodeGraphicsScene (qreal x, qreal y, qreal width, qreal height, QObject *p=nullptr) |
| |
| virtual void | cancelLink () override |
| | 取消链接,如果此时没在进行链接,不做处理
|
| |
| void | setWorkFlow (DAWorkFlow *wf) |
| | 设置工作流
|
| |
| DAWorkFlow * | getWorkflow () |
| | 获取工作流
|
| |
| DAAbstractNodeGraphicsItem * | findItemByNode (DAAbstractNode *n) |
| | 通过node找到item
|
| |
| DAAbstractNodeGraphicsItem * | getSelectedNodeGraphicsItem () const |
| | 获取选中的NodeGraphicsItem,如果没有返回nullptr,如果选中多个,返回第一个
|
| |
| QList< DAAbstractNodeGraphicsItem * > | getNodeGraphicsItems () const |
| | 获取所有的NodeGraphicsItems
|
| |
| QList< DAGraphicsStandardTextItem * > | getTextGraphicsItems () const |
| | 获取所有的文本
|
| |
| QList< DAAbstractNodeGraphicsItem * > | getSelectedNodeGraphicsItems () const |
| | 获取选中的NodeGraphicsItem,如果没有返回一个空list
|
| |
| DAAbstractNodeLinkGraphicsItem * | getSelectedNodeLinkGraphicsItem () const |
| | 获取选中的NodeLinkGraphicsItem,如果没有返回nullptr,如果选中多个,返回第一个
|
| |
|
QList< DAAbstractNodeLinkGraphicsItem * > | getSelectedNodeLinkGraphicsItems () const |
| |
| QList< QGraphicsItem * > | getGraphicsItemsWithoutLink () const |
| | 获取除了连接线以外的item
|
| |
| int | removeSelectedItems_ () |
| | 删除选中的item,此函数支持redo/undo
|
| |
|
void | removeNodeItem_ (DAAbstractNodeGraphicsItem *i) |
| |
|
void | addNodeItem_ (DAAbstractNodeGraphicsItem *i) |
| |
|
void | addNodeLink_ (DAAbstractNodeLinkGraphicsItem *link) |
| |
| DAAbstractNodeGraphicsItem * | createNode (const DANodeMetaData &md, const QPointF &pos, bool addItemToScene=true) |
| | 创建节点(不带回退功能)
|
| |
| DAAbstractNodeGraphicsItem * | createNode_ (const DANodeMetaData &md, const QPointF &pos) |
| | 通过node元对象创建工作流节点
|
| |
| DAGraphicsPixmapItem * | addPixmapItem_ (const QImage &img) |
| | 添加一个图片item
|
| |
| DAAbstractNodeGraphicsItem * | nodeItemAt (const QPointF &scenePos) const |
| | 通过位置获取DAAbstractNodeGraphicsItem
|
| |
|
| DAGraphicsScene (QObject *p=nullptr) |
| |
|
| DAGraphicsScene (const QRectF &sceneRect, QObject *p=nullptr) |
| |
|
| DAGraphicsScene (qreal x, qreal y, qreal width, qreal height, QObject *p=nullptr) |
| |
| QPointF | getCurrentMouseScenePos () const |
| | 获取当前鼠标在scene的位置
|
| |
| QPointF | getLastMousePressScenePos () const |
| | 获取最后鼠标在scene点击的位置
|
| |
| QList< QGraphicsItem * > | getSelectedMovableItems () |
| | 获取选中且能移动的item
|
| |
| QUndoCommand * | addItem_ (QGraphicsItem *item) |
| | 等同additem,但使用redo/undo来添加,可以进行redo/undo操作
|
| |
| QUndoCommand * | addItems_ (const QList< QGraphicsItem * > &its) |
| | 等同多次additem,但使用redo/undo来添加,可以进行redo/undo操作
|
| |
| QUndoCommand * | removeItem_ (QGraphicsItem *item) |
| | 等同removeItem,但使用redo/undo来添加,可以进行redo/undo操作
|
| |
|
QUndoCommand * | removeItems_ (const QList< QGraphicsItem * > &its) |
| |
| QPixmap | toPixamp (int dpi=0) |
| | 导出为pixmap
|
| |
| QImage | toImage (int dpi=0) |
| | 转换为设备相关的图片
|
| |
| void | beginLink (DAGraphicsLinkItem *linkItem, LinkMode lm=LinkModeAutoStartEndFollowMouseClick) |
| | 开始链接模式
|
| |
| bool | isStartLink () const |
| | 判断当前是否是链接模式
|
| |
| void | endLink () |
| | 结束链接模式
|
| |
|
virtual void | cancel () |
| |
| DAGraphicsLinkItem * | getCurrentLinkItem () const |
| | 获取当前正在进行连线的连接线item
|
| |
| void | setIgnoreLinkEvent (bool on) |
| | 设置忽略链接事件的处理,主要忽略mousePressEvent,mouseMoveEvent的链接事件
|
| |
| bool | isIgnoreLinkEvent () const |
| | 判断当前是否忽略链接事件
|
| |
|
void | groupingSelectItems_ () |
| | 对选中item的分组
|
| |
|
void | removeSelectItemGroup_ () |
| | 移除选中的分组
|
| |
| bool | isEnableSnapToGrid () const |
| | 是否允许对齐网格
|
| |
| bool | isShowGridLine () |
| | 是否显示网格线
|
| |
| void | setGridSize (const QSize &gs) |
| | 设置网格尺寸
|
| |
| QSize | getGridSize () const |
| | 网格尺寸
|
| |
| void | setGridLinePen (const QPen &p) |
| | 设置网格画笔
|
| |
| QPen | getGridLinePen () const |
| | 获取网格画笔
|
| |
| void | setPaintBackgroundInCache (bool on) |
| | 设置绘制背景使用缓冲
|
| |
| bool | isPaintBackgroundInCache () const |
| | 是否绘制背景使用缓冲
|
| |
| QUndoStack & | undoStack () |
| | 获取DANodeGraphicsScene内部维护的undoStack
|
| |
|
const QUndoStack & | undoStack () const |
| |
| QUndoStack * | getUndoStack () const |
| | 获取undostack指针
|
| |
|
void | setUndoStackActive () |
| | 在StackGroup中激活undoStack
|
| |
| void | push (QUndoCommand *cmd) |
| | 等同s->undoStack().push(cmd);
|
| |
| QGraphicsItem * | findItemByID (uint64_t id, bool recursion=false) const |
| | 通过id查找item,此函数性能为O(n)
|
| |
|
QList< QGraphicsItem * > | topItems () const |
| |
|
QList< QGraphicsItem * > | topItems (const QPointF &scenePos) const |
| |
| QList< DAGraphicsItem * > | selectedDAItems () const |
| | 获取选中的da item
|
| |
| void | setReady (bool on) |
| | 设置场景就绪
|
| |
| bool | isReady () const |
| | 场景是否就绪
|
| |
| bool | isHaveSceneAction () const |
| | 判断当前是否存在场景动作
|
| |
| QList< DAGraphicsLayout * > | getLayouts () const |
| | 获取所有图层
|
| |
|
bool | isReadOnly () const |
| |
| DAGraphicsTextItem * | createText_ (const QString &str=QString()) |
| | 创建并加入一个文本框
|
| |
| DAGraphicsRectItem * | createRect_ (const QPointF &p=QPointF()) |
| | 在画布中创建一个矩形
|
| |
| void | registCommandsFactory (DAGraphicsCommandsFactory *fac) |
| | 注册命令工厂
|
| |
| DAGraphicsCommandsFactory * | commandsFactory () |
| | 命令工厂
|
| |
| virtual bool | isItemCanMove (QGraphicsItem *positem, const QPointF &scenePos) |
| | 判断点击的item是否可以移动
|
| |
|
| void | setEnableSnapToGrid (bool on=true) |
| | 是否允许对齐网格
|
| |
| void | showGridLine (bool on) |
| | 显示网格线
|
| |
| int | selectAll () |
| | 选中所有item
|
| |
| int | unselectAll () |
| | 取消选择,把所有item设置为非选中状态
|
| |
|
void | clearSelection () |
| | 取消选中item
|
| |
| int | setSelectionState (const QList< QGraphicsItem * > &its, bool isSelect) |
| | 设置item的选中状态
|
| |
| void | setReadOnly (bool on) |
| | 设定为只读模式
|
| |
| void | setupSceneAction (DA::DAAbstractGraphicsSceneAction *act) |
| | 激活场景动作
|
| |
| void | clearSceneAction () |
| | 清除场景动作
|
| |
| void | nodeItemLinkPointSelected (DA::DAAbstractNodeGraphicsItem *item, const DA::DANodeLinkPoint &lp, QGraphicsSceneMouseEvent *event) |
| | 节点的连接点被选中触发的信号
|
| |
|
void | nodeLinkItemIsEmpty (DA::DAAbstractNodeLinkGraphicsItem *link) |
| | 说明link已经为空,这时会自动remove
|
| |
| void | selectNodeItemChanged (DA::DAAbstractNodeGraphicsItem *item) |
| | 选中了某个节点的设置窗口
|
| |
| void | selectNodeLinkChanged (DA::DAAbstractNodeLinkGraphicsItem *link) |
| | 选中了某个节点的设置窗口
|
| |
| void | nodeItemsRemoved (const QList< DA::DAAbstractNodeGraphicsItem * > &items) |
| | 节点被移除
|
| |
| void | nodeLinksRemoved (const QList< DA::DAAbstractNodeLinkGraphicsItem * > &items) |
| | 连接线被移除
|
| |
| void | itemsPositionChanged (const QList< QGraphicsItem * > &items, const QList< QPointF > &oldPos, const QList< QPointF > &newPos) |
| | item移动发射的信号
|
| |
| void | itemBodySizeChanged (DAGraphicsResizeableItem *item, const QSizeF &oldSize, const QSizeF &newSize) |
| | 条目bodysize改变触发的信号
|
| |
| void | itemRotationChanged (DAGraphicsResizeableItem *item, const qreal &rotation) |
| | item旋转发出的信号
|
| |
| void | linkCompleted (DAGraphicsLinkItem *linkItem) |
| | 完成了一次链接
|
| |
| void | selectItemChanged (DAGraphicsItem *item) |
| | 选中的item发生了变化,注意,选中的如果是分组,会检查分组内部的item的点击,最终也是发送被点击的item
|
| |
| void | selectLinkChanged (DAGraphicsLinkItem *item) |
| | 选中的链接线发生了改变
|
| |
| void | itemsAdded (const QList< QGraphicsItem * > &its) |
| | item添加的信号
|
| |
| void | itemsRemoved (const QList< QGraphicsItem * > &its) |
| | item移除的信号
|
| |
| void | sceneActionActived (DA::DAAbstractGraphicsSceneAction *act) |
| | 一个场景动作被激活的信号
|
| |
| void | sceneActionDeactived (DA::DAAbstractGraphicsSceneAction *act) |
| | 一个场景动作已经解除激活的信号
|
| |
| static QGraphicsItem * | findItemByID (const QList< QGraphicsItem * > &its, uint64_t id, bool recursion=false) |
| | 查找id对应的GraphicsItem*
|
| |
| static int | getDefaultDPI () |
| | 获取默认的dpi
|
| |
| static int | dpiToPx (int dpi, int r) |
| | dpi转为像素
|
| |
| static void | addItemToGroup (QGraphicsItemGroup *group, const QList< QGraphicsItem * > &willGroupItems) |
| | 通用的item分组,此操作和QGraphicsScene::createItemGroup逻辑一致
|
| |
| void | onSelectItemChanged (DAGraphicsItem *item) |
| | item选择改变
|
| |
|
void | onSelectLinkChanged (DAGraphicsLinkItem *item) |
| |
| void | onNodeNameChanged (DAAbstractNode::SharedPointer node, const QString &oldName, const QString &newName) |
| | 节点名字改变触发的槽
|
| |
| static void | classifyItems (const QList< QGraphicsItem * > &sourceItems, QList< DAAbstractNodeGraphicsItem * > &nodeItems, QList< DAAbstractNodeLinkGraphicsItem * > &linkItems, QList< QGraphicsItem * > &normalItem) |
| | 对item进行分类
|
| |
| static QList< DAAbstractNodeLinkGraphicsItem * > | getNodesAllLinkItems (const QList< DAAbstractNodeGraphicsItem * > &nodeItems) |
| | 获取node item的所有连接线
|
| |
| static QList< DAAbstractNode::SharedPointer > | nodeItemsToNodes (const QList< DAAbstractNodeGraphicsItem * > &nodeItems) |
| | 所有节点item对应的node
|
| |