mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
Minor fix : load an element or image will setpos at the same pos when was save (and not snap to grid)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3973 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -142,7 +142,8 @@ bool DiagramImageItem::fromXml(const QDomElement &e) {
|
|||||||
|
|
||||||
setScale(e.attribute("size").toDouble());
|
setScale(e.attribute("size").toDouble());
|
||||||
applyRotation(e.attribute("rotation").toDouble());
|
applyRotation(e.attribute("rotation").toDouble());
|
||||||
setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
|
//We directly call setPos from QGraphicsObject, because QetGraphicsItem will snap to grid
|
||||||
|
QGraphicsObject::setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
|
||||||
is_movable_ = (e.attribute("is_movable").toInt());
|
is_movable_ = (e.attribute("is_movable").toInt());
|
||||||
|
|
||||||
return (true);
|
return (true);
|
||||||
|
|||||||
@@ -417,8 +417,9 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
|||||||
//load informations
|
//load informations
|
||||||
element_informations_.fromXml(e.firstChildElement("elementInformations"), "elementInformation");
|
element_informations_.fromXml(e.firstChildElement("elementInformations"), "elementInformation");
|
||||||
|
|
||||||
// position, selection
|
//Position and selection.
|
||||||
setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
|
//We directly call setPos from QGraphicsObject, because QetGraphicsItem will snap to grid
|
||||||
|
QGraphicsObject::setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
|
||||||
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
||||||
|
|
||||||
// orientation
|
// orientation
|
||||||
|
|||||||
Reference in New Issue
Block a user