当前位置: 首页>>代码示例>>C++>>正文


C++ Symbol::adjustReadPos方法代码示例

本文整理汇总了C++中Symbol::adjustReadPos方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::adjustReadPos方法的具体用法?C++ Symbol::adjustReadPos怎么用?C++ Symbol::adjustReadPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symbol的用法示例。


在下文中一共展示了Symbol::adjustReadPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: read

void Symbol::read(XmlReader& e)
{
    QPointF pos;
    while (e.readNextStartElement()) {
        const QStringRef& tag(e.name());
        if (tag == "name") {
            QString val(e.readElementText());
            SymId symId = Sym::name2id(val);
            if (val != "noSym") {
                if (symId == SymId::noSym) {
                    // if symbol name not found, fall back to user names
                    // TODO : does it make sense? user names are probably localized
                    symId = Sym::userName2id(val);
                    // if not found, look into old names
                    if (symId == SymId::noSym)
                        symId = Sym::oldName2id(val);
                    if (symId == SymId::noSym) {
                        qDebug("unknown symbol <%s>, falling back to no symbol", qPrintable(val));
                        // set a default symbol, or layout() will crash
                        symId = SymId::noSym;
                    }
                }
            }
            setSym(symId);
        }
        else if (tag == "font")
            _scoreFont = ScoreFont::fontFactory(e.readElementText());
        else if (tag == "Symbol") {
            Symbol* s = new Symbol(score());
            s->read(e);
            s->adjustReadPos();
            add(s);
        }
        else if (tag == "Image") {
            if (MScore::noImages)
                e.skipCurrentElement();
            else {
                Image* image = new Image(score());
                image->read(e);
                add(image);
            }
        }
        else if (tag == "small" || tag == "subtype")    // obsolete
            e.skipCurrentElement();
        else if (!BSymbol::readProperties(e))
            e.unknown();
    }
    setPos(pos);
}
开发者ID:joergsichermann,项目名称:MuseScore,代码行数:49,代码来源:symbol.cpp

示例2: read

void Symbol::read(XmlReader& e)
      {
      QPointF pos;
      SymId s = noSym;

      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "name") {
                  QString val(e.readElementText());
                  if (val == "acc dot")               // compatibility hack
                        val = "accordion.accDot";
                  else if (val == "acc old ee")
                        val = "accordion.accOldEE";
                  s = Sym::name2id(val);
                  if (s == noSym) {
                        // if symbol name not found, fall back to mnames
                        s = Sym::userName2id(val);
                        if (s == noSym) {
                              qDebug("unknown symbol <%s> (%d symbols), falling back to default symbol",
                                 qPrintable(val), symbols[0].size());
                              // set a default symbol, or layout() will crash
                              s = s1miHeadSym;
                              }
                        }
                  }
            else if (tag == "Symbol") {
                  Symbol* s = new Symbol(score());
                  s->read(e);
                  s->adjustReadPos();
                  add(s);
                  }
            else if (tag == "Image") {
                  Image* image = new Image(score());
                  QString path;
                  image->read(e);
                  add(image);
                  }
            else if (tag == "small" || tag == "subtype")
                  ;
            else if (!BSymbol::readProperties(e))
                  e.unknown();
            }
      if (s == noSym)
            qDebug("unknown symbol");
      setPos(pos);
      setSym(s);
      }
开发者ID:Isenbarth,项目名称:MuseScore,代码行数:47,代码来源:symbol.cpp


注:本文中的Symbol::adjustReadPos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。