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


C++ TimeSig::denominatorString方法代码示例

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


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

示例1: paletteChanged

void TimeDialog::paletteChanged(int idx)
      {
      TimeSig* e = static_cast<TimeSig*>(sp->element(idx));
      if (!e || e->type() != Element::TIMESIG) {
            zNominal->setEnabled(false);
            nNominal->setEnabled(false);
            zText->setEnabled(false);
            nText->setEnabled(false);
            groups->setEnabled(false);
            addButton->setEnabled(false);
            return;
            }
      zNominal->setEnabled(true);
      nNominal->setEnabled(true);
      zText->setEnabled(true);
      nText->setEnabled(true);
      groups->setEnabled(true);
      addButton->setEnabled(true);

      Fraction sig(e->sig());
      Groups g = e->groups();
      if (g.empty())
            g = Groups::endings(sig);
      groups->setSig(sig, g);
      zNominal->setValue(sig.numerator());
      nNominal->setCurrentIndex(denominator2Idx(sig.denominator()));
      zText->setText(e->numeratorString());
      nText->setText(e->denominatorString());
      }
开发者ID:CafeCat,项目名称:MuseScore,代码行数:29,代码来源:timedialog.cpp

示例2: elementPropertyAction


//.........这里部分代码省略.........
            vp.setEndings(vs->volta()->endings());
            int rv = vp.exec();
            if (rv) {
                  QString txt  = vp.getText();
                  QList<int> l = vp.getEndings();
                  if (txt != vs->volta()->text())
                        score()->undoChangeVoltaText(vs->volta(), txt);
                  if (l != vs->volta()->endings())
                        score()->undoChangeVoltaEnding(vs->volta(), l);
                  }
            }
      else if (cmd == "l-props") {
            TextLineSegment* vs = static_cast<TextLineSegment*>(e);
            TextLine* nTl  = vs->textLine()->clone();
            LineProperties lp(nTl);
            if (lp.exec()) {
                  score()->undoChangeElement(vs->textLine(), nTl);
                  // force new text
                  foreach(SpannerSegment* l, nTl->spannerSegments())
                        static_cast<TextLineSegment*>(l)->clearText();
                  }
            else
                  delete nTl;
            }
      else if (cmd == "tr-props") {
            TremoloBar* tb = static_cast<TremoloBar*>(e);
            TremoloBarProperties bp(tb, 0);
            if (bp.exec())
                  score()->undo(new ChangeTremoloBar(tb, bp.points()));
            }
      if (cmd == "ts-courtesy") {
            TimeSig* ts = static_cast<TimeSig*>(e);
            score()->undo(new ChangeTimesig(static_cast<TimeSig*>(e), !ts->showCourtesySig(), ts->sig(),
                  ts->stretch(), ts->numeratorString(), ts->denominatorString(), ts->timeSigType()));
            }
      else if (cmd == "ts-props") {
            TimeSig* ts = static_cast<TimeSig*>(e);
            TimeSig r(*ts);
            TimeSigProperties vp(&r);
            int rv = vp.exec();
            if (rv) {
                  bool stretchChanged = r.stretch() != ts->stretch();
                  if (r.numeratorString() != ts->numeratorString()
                     || r.denominatorString() != ts->denominatorString()
                     || r.sig() != ts->sig()
                     || stretchChanged
                     || r.timeSigType() != ts->timeSigType()) {
                        score()->undo(new ChangeTimesig(ts, r.showCourtesySig(), r.sig(), r.stretch(),
                           r.numeratorString(), r.denominatorString(), r.timeSigType()));
                        if (stretchChanged)
                              score()->timesigStretchChanged(ts, ts->measure(), ts->staffIdx());
                        }
                  }
            }
      else if (cmd == "smallAcc")
            score()->undoChangeProperty(e, P_SMALL, !static_cast<Accidental*>(e)->small());
      else if (cmd == "smallNote")
            score()->undoChangeProperty(e, P_SMALL, !static_cast<Note*>(e)->small());
      else if (cmd == "clef-courtesy") {
            bool show = !static_cast<Clef*>(e)->showCourtesy();
            score()->undoChangeProperty(e, P_SHOW_COURTESY, show);
            }
      else if (cmd == "d-props") {
            Dynamic* dynamic = static_cast<Dynamic*>(e);
            Dynamic* nText = new Dynamic(*dynamic);
            TextProperties tp(nText, 0);
开发者ID:sommerp,项目名称:MuseScore,代码行数:67,代码来源:propertymenu.cpp


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