mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-08 14:49:58 +01:00
Save and read "is movable" attribute to xml for basic shape & image
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3481 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -204,6 +204,7 @@ void QetShapeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||
bool QetShapeItem::fromXml(const QDomElement &e) {
|
||||
if (e.tagName() != "shape") return (false);
|
||||
|
||||
is_movable_ = e.attribute("is_movable", "true").toInt ();
|
||||
m_shapeStyle = Qt::PenStyle(e.attribute("style","0").toInt());
|
||||
|
||||
if (e.attribute("type", "0").toInt() != Polyline) {
|
||||
@@ -235,6 +236,7 @@ QDomElement QetShapeItem::toXml(QDomDocument &document) const {
|
||||
//write some attribute
|
||||
result.setAttribute("type", QString::number(m_shapeType));
|
||||
result.setAttribute("style", QString::number(m_shapeStyle));
|
||||
result.setAttribute("is_movable", bool(is_movable_));
|
||||
|
||||
if (m_shapeType != Polyline) {
|
||||
result.setAttribute("x1", mapToScene(m_P1).x());
|
||||
|
||||
Reference in New Issue
Block a user