mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-04-17 21:19:20 +02:00
Save id in attributes in state saving.
This commit is contained in:
15
Element.cpp
15
Element.cpp
@@ -59,6 +59,21 @@ void Element::setOpacity(float opacity)
|
||||
}
|
||||
}
|
||||
|
||||
void Element::read(const QDomElement& obj)
|
||||
{
|
||||
Serializable::read(obj);
|
||||
|
||||
// Check id.
|
||||
Q_ASSERT(_id == obj.attribute("id").toInt());
|
||||
}
|
||||
|
||||
void Element::write(QDomElement& obj)
|
||||
{
|
||||
Serializable::write(obj);
|
||||
// Set id.
|
||||
obj.setAttribute("id", getId());
|
||||
}
|
||||
|
||||
void Element::_emitPropertyChanged(const QString& propertyName)
|
||||
{
|
||||
emit propertyChanged(getId(), propertyName, property(propertyName.toAscii()));
|
||||
|
||||
Reference in New Issue
Block a user