DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAGraphicsDrawTextItemSceneAction.h
1#ifndef DAGRAPHICSDRAWTEXTITEMSCENEACTION_H
2#define DAGRAPHICSDRAWTEXTITEMSCENEACTION_H
3#include "DAGraphicsViewGlobal.h"
4#include "DAAbstractGraphicsSceneAction.h"
5namespace DA
6{
7class DAGraphicsRubberBandItem;
12{
13public:
16
17protected:
18 // 开始激活,这是使用setAction后调用的函数
19 virtual void beginActive();
20 // 鼠标点击事件,返回true,代表action劫持了此事件,不会在scene中继续传递事件,默认返回false
21 virtual bool mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent);
22 // 鼠标释放
23 virtual bool mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent);
24 // 鼠标移动事件,返回true,代表action劫持了此事件,不会在scene中继续传递事件,默认返回false
25 virtual bool mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent);
26
27private:
28 QPointF mStartPoint;
29 bool mIsStarted { false };
30 std::unique_ptr< DAGraphicsRubberBandItem > mRubberBand;
31};
32}
33#endif // DAGRAPHICSDRAWTEXTITEMSCENEACTION_H
这是一个scene的动作,DAGraphicsScene支持持有一个动作,这个动作可以捕获scene的所有界面事件
Definition DAAbstractGraphicsSceneAction.h:22
绘制文本action
Definition DAGraphicsDrawTextItemSceneAction.h:12
这是带着undostack的GraphicsScene 此QGraphicsScene支持:
Definition DAGraphicsScene.h:30
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44