DAWorkbench
0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAGraphicsDrawTextItemSceneAction.h
1
#ifndef DAGRAPHICSDRAWTEXTITEMSCENEACTION_H
2
#define DAGRAPHICSDRAWTEXTITEMSCENEACTION_H
3
#include "DAGraphicsViewGlobal.h"
4
#include "DAAbstractGraphicsSceneAction.h"
5
namespace
DA
6
{
7
class
DAGraphicsRubberBandItem;
11
class
DAGRAPHICSVIEW_API
DAGraphicsDrawTextItemSceneAction
:
public
DAAbstractGraphicsSceneAction
12
{
13
public
:
14
DAGraphicsDrawTextItemSceneAction
(
DAGraphicsScene
* sc);
15
virtual
~DAGraphicsDrawTextItemSceneAction
();
16
17
protected
:
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
27
private
:
28
QPointF mStartPoint;
29
bool
mIsStarted {
false
};
30
std::unique_ptr< DAGraphicsRubberBandItem > mRubberBand;
31
};
32
}
33
#endif
// DAGRAPHICSDRAWTEXTITEMSCENEACTION_H
DA::DAAbstractGraphicsSceneAction
这是一个scene的动作,DAGraphicsScene支持持有一个动作,这个动作可以捕获scene的所有界面事件
Definition
DAAbstractGraphicsSceneAction.h:22
DA::DAGraphicsDrawTextItemSceneAction
绘制文本action
Definition
DAGraphicsDrawTextItemSceneAction.h:12
DA::DAGraphicsScene
这是带着undostack的GraphicsScene 此QGraphicsScene支持:
Definition
DAGraphicsScene.h:30
DA
序列化类都是带异常的,使用中需要处理异常
Definition
AppMainWindow.cpp:44
src
DAGraphicsView
DAGraphicsDrawTextItemSceneAction.h
制作者
1.9.8