The DAGraphicsLabelItem class
更多...
#include <DAGraphicsLabelItem.h>
|
| enum | { Type = DA::ItemType_DAGraphicsLabelItem
} |
| | 适用qgraphicsitem_cast
|
| |
|
|
int | type () const override |
| |
|
| DAGraphicsLabelItem (QGraphicsItem *parent=nullptr) |
| |
|
| DAGraphicsLabelItem (const QString &str, QGraphicsItem *parent=nullptr) |
| |
| virtual bool | saveToXml (QDomDocument *doc, QDomElement *parentElement, const QVersionNumber &ver) const override |
| |
| virtual bool | loadFromXml (const QDomElement *itemElement, const QVersionNumber &ver) override |
| |
|
uint64_t | getItemID () const |
| |
|
void | setItemID (uint64_t id) |
| |
|
void | setRelativePosition (qreal xp, qreal yp) |
| |
|
QPointF | getRelativePosition () const |
| |
|
bool | isHaveRelativePosition () const |
| |
| void | setAttachPoint (DAShapeKeyPoint parentAttachPoint) |
| | 设置相对贴附位置
|
| |
|
void | setOriginPoint (DAShapeKeyPoint originPoint) |
| |
|
DAShapeKeyPoint | getOriginPoint () const |
| |
|
void | updatePosition () |
| | 更新位置
|
| |
|
void | setSelectable (bool on) |
| |
|
|
virtual QVariant | itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) override |
| |
|
| 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
|
| |
◆ loadFromXml()
| bool DA::DAGraphicsLabelItem::loadFromXml |
( |
const QDomElement * |
itemElement, |
|
|
const QVersionNumber & |
ver |
|
) |
| |
|
overridevirtual |
◆ saveToXml()
| bool DA::DAGraphicsLabelItem::saveToXml |
( |
QDomDocument * |
doc, |
|
|
QDomElement * |
parentElement, |
|
|
const QVersionNumber & |
ver |
|
) |
| const |
|
overridevirtual |
◆ setAttachPoint()
| void DA::DAGraphicsLabelItem::setAttachPoint |
( |
DAShapeKeyPoint |
parentAttachPoint | ) |
|
设置相对贴附位置
TopLeft TopCenter TopRight
(0,0)----------(0.5,0)------------(1,0)
| |
|CenterLeft Center CenterRight|
(0,0.5) (0.5,0.5) (1,0.5)
| |
|BottomLeft BottomCenter BottomRight|
(0,1)----------(0.5,1)------------(1,1)
- 参数
-
该类的文档由以下文件生成:
- /home/runner/work/data-workbench/data-workbench/src/DAGraphicsView/DAGraphicsLabelItem.h
- /home/runner/work/data-workbench/data-workbench/src/DAGraphicsView/DAGraphicsLabelItem.cpp