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


C++ setSubtype函数代码示例

本文整理汇总了C++中setSubtype函数的典型用法代码示例。如果您正苦于以下问题:C++ setSubtype函数的具体用法?C++ setSubtype怎么用?C++ setSubtype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: setSubtype

void Articulation::read(const QDomElement& de)
      {
      setSubtype(Articulation_Staccato);    // default
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());
            if (tag == "subtype")
                  setSubtype(val);
            else if (tag == "channel")
                  _channelName = e.attribute("name");
            else if (tag == "anchor")
                  _anchor = ArticulationAnchor(val.toInt());
            else if (tag == "direction") {
                  Direction dir = AUTO;
                  if (val == "up")
                        dir = UP;
                  else if (val == "down")
                        dir = DOWN;
                  else if (val == "auto")
                        dir = AUTO;
                  else
                        domError(e);
                  setDirection(dir);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
开发者ID:Archer90,项目名称:MuseScore,代码行数:28,代码来源:articulation.cpp

示例2: setSubtype

void Articulation::read(const QDomElement& de)
      {
      setSubtype(Articulation_Fermata);    // default // backward compatibility (no type = ufermata in 1.2)
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());
            if (tag == "subtype")
                  setSubtype(val);
            else if (tag == "channel")
                  _channelName = e.attribute("name");
            else if (tag == "anchor")
                  _anchor = ArticulationAnchor(val.toInt());
            else if (tag == "direction") {
                  MScore::Direction dir = MScore::AUTO;
                  if (val == "up")
                        dir = MScore::UP;
                  else if (val == "down")
                        dir = MScore::DOWN;
                  else if (val == "auto")
                        dir = MScore::AUTO;
                  else
                        domError(e);
                  setDirection(dir);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
开发者ID:aiena,项目名称:MuseScore,代码行数:28,代码来源:articulation.cpp

示例3: setSubtype

void Articulation::read(QDomElement e)
      {
      setSubtype(0);    // default
      for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            QString tag(e.tagName());
            QString val(e.text());
            if (tag == "idx")                         // obsolete
                  setSubtype(val.toInt());
            else if (tag == "channel")
                  _channelName = e.attribute("name");
            else if (tag == "anchor")
                  _anchor = ArticulationAnchor(val.toInt());
            else if (tag == "direction") {
                  Direction dir = AUTO;
                  if (val == "up")
                        dir = UP;
                  else if (val == "down")
                        dir = DOWN;
                  else if (val == "auto")
                        dir = AUTO;
                  else
                        domError(e);
//                  printf("setDirection %s %d\n", qPrintable(val), int(dir));
                  setDirection(dir);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
/* if (subtype() == Articulation_Schleifer) {
            printf("Schleifer %f %f\n", readPos().x(), readPos().y());
            setReadPos(QPointF());
            }
      */
      }
开发者ID:SSMN,项目名称:MuseScore,代码行数:34,代码来源:articulation.cpp

示例4: staff

void BarLine::read(const QDomElement& de)
      {
      // if bar line belongs to a staff, span values default to staff values
      if(staff()) {
            _span       = staff()->barLineSpan();
            _spanFrom   = staff()->barLineFrom();
            _spanTo     = staff()->barLineTo();
      }
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());
            if (tag == "subtype") {
                  bool ok;
                  int i = val.toInt(&ok);
                  if (!ok)
                        setSubtype(val);
                  else {
                        BarLineType ct = NORMAL_BAR;
                        switch (i) {
                              default:
                              case  0: ct = NORMAL_BAR; break;
                              case  1: ct = DOUBLE_BAR; break;
                              case  2: ct = START_REPEAT; break;
                              case  3: ct = END_REPEAT; break;
                              case  4: ct = BROKEN_BAR; break;
                              case  5: ct = END_BAR; break;
                              case  6: ct = END_START_REPEAT; break;
                              case  7: ct = DOTTED_BAR; break;
                              }
                        setSubtype(ct);
                        }
                  if(parent() && parent()->type() == SEGMENT) {
                        Measure* m = static_cast<Segment*>(parent())->measure();
                        if(subtype() != m->endBarLineType())
                              setCustomSubtype(true);
                        }
                  }
            else if (tag == "customSubtype")
                  setCustomSubtype(val.toInt() != 0);
            else if (tag == "span") {
                  _span       = val.toInt();
                  _spanFrom   = e.attribute("from", QString::number(_spanFrom)).toInt();
                  _spanTo     = e.attribute("to", QString::number(_spanTo)).toInt();
                  // WARNING: following statements assume staff and staff bar line spans are correctly set
                  if(staff() && (_span != staff()->barLineSpan()
                              || _spanFrom != staff()->barLineFrom() || _spanTo != staff()->barLineTo()))
                        _customSpan = true;
                  }
            else if (tag == "Articulation") {
                  Articulation* a = new Articulation(score());
                  a->read(e);
                  add(a);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
开发者ID:aeliot,项目名称:MuseScore,代码行数:57,代码来源:barline.cpp

示例5: sizeof

void Accidental::setSubtype(const QString& tag)
      {
      int n = sizeof(accList)/sizeof(*accList);
      for (int i = 0; i < n; ++i) {
            if (accList[i].tag == tag) {
                  setSubtype(AccidentalType(i));
                  return;
                  }
            }
      setSubtype(ACC_NONE);
      }
开发者ID:Archer90,项目名称:MuseScore,代码行数:11,代码来源:accidental.cpp

示例6: setSubtype

void StaffState::setSubtype(const QString& s)
      {
      if (s == "instrument")
            setSubtype(STAFF_STATE_INSTRUMENT);
      else if (s == "type")
            setSubtype(STAFF_STATE_TYPE);
      else if (s == "visible")
            setSubtype(STAFF_STATE_VISIBLE);
      else if (s == "invisible")
            setSubtype(STAFF_STATE_INVISIBLE);
      }
开发者ID:Isenbarth,项目名称:MuseScore,代码行数:11,代码来源:staffstate.cpp

示例7: QPainterPath

void ChordLine::read(const QDomElement& de)
      {
      path = QPainterPath();
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            QString tag(e.tagName());
            if (tag == "Path") {
                  path = QPainterPath();
                  QPointF curveTo;
                  QPointF p1;
                  int state = 0;
                  for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
                        QString tag(ee.tagName());
                        if (tag == "Element") {
                              int type = ee.attribute("type").toInt();
                              qreal x = ee.attribute("x").toDouble();
                              qreal y = ee.attribute("y").toDouble();
                              switch(QPainterPath::ElementType(type)) {
                                    case QPainterPath::MoveToElement:
                                          path.moveTo(x, y);
                                          break;
                                    case QPainterPath::LineToElement:
                                          path.lineTo(x, y);
                                          break;
                                    case QPainterPath::CurveToElement:
                                          curveTo.rx() = x;
                                          curveTo.ry() = y;
                                          state = 1;
                                          break;
                                    case QPainterPath::CurveToDataElement:
                                          if (state == 1) {
                                                p1.rx() = x;
                                                p1.ry() = y;
                                                state = 2;
                                                }
                                          else if (state == 2) {
                                                path.cubicTo(curveTo, p1, QPointF(x, y));
                                                state = 0;
                                                }
                                          break;
                                    }
                              }
                        else
                              domError(ee);
                        }
                  modified = true;
                  setSubtype(ChordLineType(0));
                  }
            else if (tag == "subtype")
                  setSubtype(ChordLineType(e.text().toInt()));
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
开发者ID:alexkonradi,项目名称:MuseScore,代码行数:53,代码来源:chordline.cpp

示例8: sizeof

void Dynamic::setSubtype(const QString& tag)
      {
      int n = sizeof(dynList)/sizeof(*dynList);
      for (int i = 0; i < n; ++i) {
            if (dynList[i].tag == tag) {
                  setSubtype(DynamicType(i));
                  setText(QString::fromUtf8(dynList[i].text));
                  return;
                  }
            }
      setSubtype(DYNAMIC_OTHER);
      setText(tag);
      }
开发者ID:Isenbarth,项目名称:MuseScore,代码行数:13,代码来源:dynamic.cpp

示例9: Text

Marker::Marker(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setSubtype(TEXT_REPEAT);
      setTextStyle(TEXT_STYLE_REPEAT);
      }
开发者ID:SSMN,项目名称:MuseScore,代码行数:7,代码来源:repeat.cpp

示例10: setArticulationType

void Articulation::read(XmlReader& e)
      {
      setArticulationType(ArticulationType::Fermata);    // default // backward compatibility (no type = ufermata in 1.2)
      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "subtype")
                  setSubtype(e.readElementText());
            else if (tag == "channel") {
                  _channelName = e.attribute("name");
                  e.readNext();
                  }
            else if (tag == "anchor") {
                  _anchor = ArticulationAnchor(e.readInt());
                  anchorStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "direction")
                  setProperty(P_ID::DIRECTION, Ms::getProperty(P_ID::DIRECTION, e));
            else if ( tag == "ornamentStyle")
                  setProperty(P_ID::ORNAMENT_STYLE, Ms::getProperty(P_ID::ORNAMENT_STYLE, e));
            else if ( tag == "play")
                  setPlayArticulation(e.readBool());
            else if (tag == "timeStretch")
                  _timeStretch = e.readDouble();
            else if (tag == "offset") {
                  if (score()->mscVersion() > 114)
                        Element::readProperties(e);
                  else
                        e.skipCurrentElement(); // ignore manual layout in older scores
                  }
            else if (!Element::readProperties(e))
                  e.unknown();
            }
      }
开发者ID:FryderykChopin,项目名称:MuseScore,代码行数:33,代码来源:articulation.cpp

示例11: VirtualCluster

CRMAcctCluster::CRMAcctCluster(QWidget* pParent, const char* pName) :
    VirtualCluster(pParent, pName)
{
    addNumberWidget(new CRMAcctLineEdit(this, pName));
    setNameVisible(true);
    setSubtype(CRMAcctLineEdit::Crmacct);
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:7,代码来源:crmacctCluster.cpp

示例12: tag

bool LineSegment::readProperties(XmlReader& e)
      {
      const QStringRef& tag(e.name());
      if (tag == "subtype")
            setSubtype(SpannerSegmentType(e.readInt()));
      else if (tag == "off1")       // obsolete
            setUserOff(e.readPoint() * spatium());
      else if (tag == "off2")
            setUserOff2(e.readPoint() * spatium());
      else if (tag == "pos") {
            if (score()->mscVersion() > 114) {
                  qreal _spatium = spatium();
                  setUserOff(QPointF());
                  setReadPos(e.readPoint() * _spatium);
                  }
            else
                  e.readNext();
            }
#if 0
      else if (tag == "pos") {
            QPointF rp = e.readPoint() * spatium();
            if ((score()->mscVersion() <= 114) && (type() == VOLTA_SEGMENT)) {
                  rp.ry() -= spatium();
                  }
            setReadPos(rp);
            }
#endif
      else if (!Element::readProperties(e)) {
            e.unknown();
            return false;
            }
      return true;
      }
开发者ID:Isenbarth,项目名称:MuseScore,代码行数:33,代码来源:line.cpp

示例13: Being

NPC::NPC(int id, int subtype, Map *map):
    Being(id, subtype, map)
{
    setSubtype(subtype);

    setShowName(true);
}
开发者ID:Ablu,项目名称:invertika,代码行数:7,代码来源:npc.cpp

示例14: Text

Dynamic::Dynamic(const Dynamic& d)
   : Text(d)
      {
      setSubtype(subtype());
      _velocity = d._velocity;
      _dynType  = d._dynType;
      }
开发者ID:SSMN,项目名称:MuseScore,代码行数:7,代码来源:dynamics.cpp

示例15: mCurrentFrame

BackgroundSuppressionShell::BackgroundSuppressionShell() :
            mCurrentFrame(0), mCurrentProgress(0.0), mProgressStep(1.0), mpRaster(NULL), mSingleForegroundMask(false), mpTemporaryBuffer(NULL)
{
   setSubtype("Background Estimation");
   setAbortSupported(true);
   setWizardSupported(true);
   mpAnimation.addSignal(SIGNAL_NAME(Animation, FrameChanged), Slot(this, &BackgroundSuppressionShell::processNextStreamingFrame));
}
开发者ID:Siddharthk,项目名称:coan,代码行数:8,代码来源:BackgroundSuppressionShell.cpp


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