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

用于节点显示的GraphicsView 更多...

#include <DAWorkFlowGraphicsView.h>

类 DA::DAWorkFlowGraphicsView 继承关系图:
DA::DAGraphicsView

class  PrivateData
 

信号

void nodeItemDeleted (const QList< QGraphicsItem * > &items)
 节点删除
 
void pastedItems (const QList< QGraphicsItem * > &items)
 粘贴触发的信号
 
- 信号 继承自 DA::DAGraphicsView
void viewActionActived (DA::DAAbstractGraphicsViewAction *act)
 一个视图动作被激活的信号
 
void viewActionDeactived (DA::DAAbstractGraphicsViewAction *act)
 一个视图动作已经解除激活的信号
 

Public 成员函数

 DAWorkFlowGraphicsView (QWidget *parent=0)
 
 DAWorkFlowGraphicsView (QGraphicsScene *scene, QWidget *parent=0)
 
void setWorkFlow (DAWorkFlow *wf)
 DAWorkFlowGraphicsView不负责workflow的所有权
 
DAWorkFlowgetWorkflow ()
 DAWorkFlowGraphicsView::workflow
 
void setUndoStackActive ()
 
QUndoStack * getUndoStack ()
 
DAWorkFlowGraphicsScenegetWorkFlowGraphicsScene ()
 获取DAWorkFlowGraphicsScene
 
QPointF getViewCenterMapToScene () const
 获取当前view视图下的scene中心
 
void moveItemToViewCenter (QGraphicsItem *item)
 把item移动到屏幕中心
 
bool copySelectItems ()
 复制选中条目,如果没有选中返回false
 
void copyItems (const QList< DAGraphicsItem * > &its, bool isCopy=true)
 
void cutSelectItems ()
 剪切
 
QList< QGraphicsItem * > paste ()
 
void pasteToViewCenter ()
 
void pasteByOffset (const QPointF &offset)
 
void setSelectionState (const QList< QGraphicsItem * > &items, bool isSelect)
 设置item的选中状态
 
void clearSelection ()
 取消选中
 
void selectAll ()
 全选
 
void offsetItems (const QList< QGraphicsItem * > &its, const QPointF &offset)
 所有item偏移一个距离,连接线不进行偏移
 
DAAbstractNodeGraphicsItemcreateNode (const DANodeMetaData &md, const QPoint &pos)
 创建节点(不带回退功能)
 
DAAbstractNodeGraphicsItemcreateNode_ (const DANodeMetaData &md, const QPoint &pos)
 
- Public 成员函数 继承自 DA::DAGraphicsView
 DAGraphicsView (QWidget *parent=0)
 DAGraphicsView
 
 DAGraphicsView (QGraphicsScene *scene, QWidget *parent=0)
 
void setScaleRange (qreal min, qreal max)
 
qreal getScaleMaxFactor () const
 
qreal getScaleMinFactor () const
 
bool isEnaleWheelZoom () const
 
void setEnaleWheelZoom (bool enaleWheelZoom=true, ZoomFlags zf=ZoomUseWheelAndCtrl)
 
QPointF getMouseScenePos () const
 获取鼠标对应的scence的位置坐标
 
void setZoomFrags (ZoomFlags zf)
 设置zoomflags
 
ZoomFlags getZoomFlags () const
 获取zoomflags
 
bool isPadding () const
 判断是否在拖动
 
void setPaddingFrags (PadFlags pf)
 设置拖动属性
 
PadFlags getPaddingFrags () const
 获取拖动属性
 
QList< DAGraphicsItem * > selectedDAItems () const
 选中的item
 
bool isSpacebarPressed () const
 是否空格被按下
 
void setupViewAction (DAAbstractGraphicsViewAction *act)
 激活一个动作,DA::DAAbstractGraphicsViewAction 的内存归view管理,此函数发射viewActionActived
 
void clearViewAction ()
 清除视图action,此操作会把当前维护的视图action清除.
 
void markPoint (const QPointF &scenePoint, const QPen &pen=QPen(Qt::blue))
 标记一个点,让这个点显示出来
 
bool isEnableMarker () const
 marker是否生效
 
DAGraphicsViewOverlayMouseMarker::MarkerStyle getCurrentMarkerStyle () const
 获取当前的markerstyle,如果没生效,返回DAGraphicsViewOverlayMouseMarker::NoMarkerStyle
 
DAGraphicsViewOverlayMouseMarkergetMarker () const
 获取marker指针
 

静态 Public 成员函数

static QRectF calcItemsSceneRange (const QList< QGraphicsItem * > &its)
 计算item所包含的范围,这个范围存入xml中,以便让scene第一时间知道总体范围
 
static QList< QGraphicsItem * > cast (const QList< DAGraphicsItem * > &its)
 

Protected 成员函数

virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void keyReleaseEvent (QKeyEvent *event) override
 
virtual void dragEnterEvent (QDragEnterEvent *event) override
 
virtual void dragMoveEvent (QDragMoveEvent *event) override
 
virtual void dragLeaveEvent (QDragLeaveEvent *event) override
 
virtual void dropEvent (QDropEvent *event) override
 
- Protected 成员函数 继承自 DA::DAGraphicsView
virtual void wheelEvent (QWheelEvent *event) override
 中键滚动
 
virtual void resizeEvent (QResizeEvent *event) override
 
void wheelZoom (QWheelEvent *event)
 滚轮事件的缩放
 
void startPad (QMouseEvent *event)
 开始拖动
 
void endPad ()
 结束拖动
 
virtual DAGraphicsViewOverlayMouseMarkercreateMarker ()
 创建鼠标标记,如果重载了DAGraphicsViewOverlayMouseMarker,需要重载此函数返回自己的MouseMarker
 

额外继承的成员函数

- Public 类型 继承自 DA::DAGraphicsView
enum  ZoomFlag { ZoomNotUseWheel = 0x0001 , ZoomUseWheel = 0x0002 , ZoomUseWheelAndCtrl = 0x0004 }
 缩放设置 更多...
 
enum  PadFlag { PadDiable = 0x0001 , PadByWheelMiddleButton = 0x0002 , PadBySpaceWithMouseLeftButton = 0x0004 }
 表征拖动状态 更多...
 
- Public 槽 继承自 DA::DAGraphicsView
void zoomIn ()
 放大
 
void zoomOut ()
 缩小
 
void zoomFit ()
 设置全部可见尺寸
 
void selectAll ()
 选中所有可选的item
 
void clearSelection ()
 取消所有选中
 
void setViewMarkerStyle (DAGraphicsViewOverlayMouseMarker::MarkerStyle style)
 设置标记
 
void setViewMarkerEnable (bool on)
 设置mark是否生效
 

详细描述

用于节点显示的GraphicsView

成员函数说明

◆ calcItemsSceneRange()

QRectF DA::DAWorkFlowGraphicsView::calcItemsSceneRange ( const QList< QGraphicsItem * > &  its)
static

计算item所包含的范围,这个范围存入xml中,以便让scene第一时间知道总体范围

参数
its
返回

◆ copySelectItems()

bool DA::DAWorkFlowGraphicsView::copySelectItems ( )

复制选中条目,如果没有选中返回false

返回

◆ createNode()

DAAbstractNodeGraphicsItem * DA::DAWorkFlowGraphicsView::createNode ( const DANodeMetaData md,
const QPoint &  pos 
)

创建节点(不带回退功能)

注解
注意,节点会记录在工作流中,如果返回的是nullptr,则不会记录
参数
md
posview的位置
返回

◆ getViewCenterMapToScene()

QPointF DA::DAWorkFlowGraphicsView::getViewCenterMapToScene ( ) const

获取当前view视图下的scene中心

返回

◆ getWorkflow()

DAWorkFlow * DA::DAWorkFlowGraphicsView::getWorkflow ( )

DAWorkFlowGraphicsView::workflow

返回

◆ getWorkFlowGraphicsScene()

DAWorkFlowGraphicsScene * DA::DAWorkFlowGraphicsView::getWorkFlowGraphicsScene ( )

获取DAWorkFlowGraphicsScene

返回

◆ keyPressEvent()

void DA::DAWorkFlowGraphicsView::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

◆ keyReleaseEvent()

void DA::DAWorkFlowGraphicsView::keyReleaseEvent ( QKeyEvent *  event)
overrideprotectedvirtual

◆ mouseMoveEvent()

void DA::DAWorkFlowGraphicsView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ mousePressEvent()

void DA::DAWorkFlowGraphicsView::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ mouseReleaseEvent()

void DA::DAWorkFlowGraphicsView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ moveItemToViewCenter()

void DA::DAWorkFlowGraphicsView::moveItemToViewCenter ( QGraphicsItem *  item)

把item移动到屏幕中心

参数
item

◆ nodeItemDeleted

void DA::DAWorkFlowGraphicsView::nodeItemDeleted ( const QList< QGraphicsItem * > &  items)
signal

节点删除

参数
item节点

◆ offsetItems()

void DA::DAWorkFlowGraphicsView::offsetItems ( const QList< QGraphicsItem * > &  its,
const QPointF &  offset 
)

所有item偏移一个距离,连接线不进行偏移

参数
its
offset

◆ paste()

QList< QGraphicsItem * > DA::DAWorkFlowGraphicsView::paste ( )

首先获取剪切板信息

把原来选中的取消选中,把粘贴的选中

1.首先判断是否是project工程,如果是工程的话,直接把工程复制进来

2.如果不是工程,判断是否是图片

◆ pastedItems

void DA::DAWorkFlowGraphicsView::pastedItems ( const QList< QGraphicsItem * > &  items)
signal

粘贴触发的信号

此信号在粘贴完成时触发

参数
items粘贴产生的新节点,此时节点都已经加入了场景中

◆ setSelectionState()

void DA::DAWorkFlowGraphicsView::setSelectionState ( const QList< QGraphicsItem * > &  items,
bool  isSelect 
)

设置item的选中状态

参数
items
isSelect

◆ setWorkFlow()

void DA::DAWorkFlowGraphicsView::setWorkFlow ( DAWorkFlow wf)

DAWorkFlowGraphicsView不负责workflow的所有权

参数
wf

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