mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-26 13:20:52 +01:00
Merge commit '77710e1cc5e597d06196d2ee163198176032987a'
Conflicts: sources/conductorproperties.cpp sources/qetgraphicsitem/element.cpp sources/qetgraphicsitem/qetshapeitem.cpp
This commit is contained in:
@@ -853,26 +853,8 @@ bool QetShapeItem::fromXml(const QDomElement &e)
|
||||
m_brush = QETXML::brushFromXml(e.firstChildElement("brush"));
|
||||
|
||||
QString type = e.attribute("type");
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO Compatibility for version older than N??4075, shape type was stored with an int")
|
||||
#endif
|
||||
//@TODO Compatibility for version older than N??4075, shape type was stored with an int
|
||||
if (type.size() == 1)
|
||||
{
|
||||
switch(e.attribute("type","0").toInt())
|
||||
{
|
||||
case 0: m_shapeType = Line; break;
|
||||
case 1: m_shapeType = Rectangle; break;
|
||||
case 2: m_shapeType = Ellipse; break;
|
||||
case 3: m_shapeType = Polygon; break;
|
||||
}
|
||||
}
|
||||
//For version after N??4075, shape is stored with a string
|
||||
else
|
||||
{
|
||||
QMetaEnum me = metaObject()->enumerator(metaObject()->indexOfEnumerator("ShapeType"));
|
||||
m_shapeType = QetShapeItem::ShapeType(me.keysToValue(type.toStdString().data()));
|
||||
}
|
||||
QMetaEnum me = metaObject()->enumerator(metaObject()->indexOfEnumerator("ShapeType"));
|
||||
m_shapeType = QetShapeItem::ShapeType(me.keysToValue(type.toStdString().data()));
|
||||
|
||||
if (m_shapeType != Polygon)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user