void KeyList::read(QDomElement e, Score* cs) { for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) { QString tag(e.tagName()); if (tag == "key") { KeySigEvent ke; int tick = e.attribute("tick", "0").toInt(); if (e.hasAttribute("custom")) ke.setCustomType(e.attribute("custom").toInt()); else ke.setAccidentalType(e.attribute("idx").toInt()); (*this)[cs->fileDivision(tick)] = ke; } else domError(e); } }
void KeyList::read(XmlReader& e, Score* cs) { while (e.readNextStartElement()) { if (e.name() == "key") { KeySigEvent ke; int tick = e.intAttribute("tick", 0); if (e.hasAttribute("custom")) ke.setCustomType(e.intAttribute("custom")); else ke.setAccidentalType(e.intAttribute("idx")); (*this)[cs->fileDivision(tick)] = ke; e.readNext(); } else e.unknown(); } }