コード例 #1
0
ファイル: line.cpp プロジェクト: guifre2/MuseScore
bool SLine::readProperties(const QDomElement& e)
      {
      if (Element::readProperties(e))
            return true;
      const QString& tag(e.tagName());
      const QString& val(e.text());
      int i = val.toInt();

      if (tag == "tick2")           // obsolete
            __setTick2(score()->fileDivision(i));
      else if (tag == "tick")       // obsolete
            __setTick1(score()->fileDivision(i));
      else if (tag == "Segment") {
            LineSegment* ls = createLineSegment();
            ls->read(e);
            add(ls);
            }
      else if (tag == "track")
            setTrack(i);
      else if (tag == "length")
            setLen(val.toDouble());
      else if (tag == "diagonal")
            setDiagonal(i);
      else if (tag == "anchor")
            setAnchor(Anchor(i));
      else
            return false;
      return true;
      }
コード例 #2
0
ファイル: line.cpp プロジェクト: Isenbarth/MuseScore
bool SLine::readProperties(XmlReader& e)
      {
      const QStringRef& tag(e.name());

      if (tag == "tick2")           // obsolete
            __setTick2(score()->fileDivision(e.readInt()));
      else if (tag == "tick")       // obsolete
            __setTick1(score()->fileDivision(e.readInt()));
      else if (tag == "Segment") {
            LineSegment* ls = createLineSegment();
            ls->read(e);
            add(ls);
            }
      else if (tag == "length")
            setLen(e.readDouble());
      else if (tag == "diagonal")
            setDiagonal(e.readInt());
      else if (tag == "anchor")
            setAnchor(Anchor(e.readInt()));
      else if (Element::readProperties(e))
            ;
      else
            return false;
      return true;
      }