|
| virtual int | type () const override |
| |
|
| DAGraphicsMarkItem (QGraphicsItem *parent=nullptr) |
| |
| virtual bool | saveToXml (QDomDocument *doc, QDomElement *parentElement, const QVersionNumber &ver) const override |
| | 保存到xml中
|
| |
| virtual bool | loadFromXml (const QDomElement *parentElement, const QVersionNumber &ver) override |
| | 从xml中加载
|
| |
|
void | setMarkBoundingRect (const QRectF &r) |
| |
|
void | setMarkShape (int shapeStyle) |
| |
|
int | getMarkShape () const |
| |
|
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
| |
|
virtual QRectF | boundingRect () const override |
| |
|
| DAGraphicsItem (QGraphicsItem *parent=nullptr) |
| |
| void | setBorderPen (const QPen &p) |
| | 设置边框画笔
|
| |
| QPen | getBorderPen () const |
| | 获取当前边框画笔
|
| |
| void | setShowBorder (bool on) |
| | 设置显示边框
|
| |
| bool | isShowBorder () const |
| | 是否显示边框
|
| |
| void | setSelectable (bool on=true) |
| | 设置是否可选中
|
| |
| bool | isSelectable () const |
| | 判断可否被选中
|
| |
| void | setMovable (bool on=true) |
| | 设置为是否可移动
|
| |
| bool | isMovable () const |
| | 判断是否可以移动
|
| |
| void | setBackgroundBrush (const QBrush &b) |
| | 设置背景
|
| |
| QBrush | getBackgroundBrush () const |
| | 获取背景
|
| |
| void | enableShowBackground (bool on) |
| | 设置显示背景
|
| |
| bool | isShowBackground () const |
| | 是否显示背景
|
| |
| virtual void | groupPositionChanged (const QPointF &p) |
| | 分组的位置发生了改变 此函数是在分组后才会回调,分组后,分组的移动对于item来说是不移动的,这时候无法触发ItemPositionChanged的改变,从而导致一些异常,因此需要分组告诉子对象分组移动了
|
| |
|
void | setScenePos (const QPointF &p) |
| |
|
void | setScenePos (qreal x, qreal y) |
| |
|
uint64_t | getItemID () const |
| |
|
void | setItemID (uint64_t id) |
| |
| bool | isSceneReadOnly () const |
| | 判断当前场景是否为只读模式,只读模式不允许操作
|
| |
|
| static DAGraphicsItem * | cast (QGraphicsItem *i) |
| | dynamic_cast为DAGraphicsItem
|
| |
| template<typename std_container_like > |
| static QDomElement | makeElement (const std_container_like &v, const QString &tagName, QDomDocument *doc) |
| | 生成一个文本
|
| |
| template<typename std_container_like > |
| static bool | loadElement (std_container_like &v, const QDomElement *ele) |
| | 加载文本
|
| |
|
static QDomElement | makeSysInfoElement (const QString &tagName, QDomDocument *doc) |
| |
| static void | appendElementWithText (QDomElement &parent, const QString &tagName, const QString &text, QDomDocument *doc) |
| | 在parent下,插入一个tag,tag下包含文字text
|
| |
|
DAGraphicsScene * | daScene () const |
| |
| virtual QVariant | itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) override |
| | 这里主要对只读模式的过滤
|
| |
DAGraphicsView的基本元件
DAGraphicsItem提供了统一的saveToXml接口 加载的过程通过DAGraphicsItemFactory进行加载