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


C++ Tuplet::bracketType方法代码示例

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


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

示例1: elementPropertyAction


//.........这里部分代码省略.........
            BoxProperties vp(static_cast<Box*>(e), 0);
            vp.exec();
            }
      else if (cmd == "measure-props") {
            MeasureProperties vp(static_cast<Note*>(e)->chord()->segment()->measure());
            vp.exec();
            }
      else if (cmd == "frame-text") {
            Text* s = new Text(score());
//            s->setSubtype(TEXT_FRAME);
            s->setTextStyleType(TEXT_STYLE_FRAME);
            s->setParent(e);
            score()->undoAddElement(s);
            score()->select(s, SELECT_SINGLE, 0);
            startEdit(s);
            score()->setLayoutAll(true);
            }
      else if (cmd == "picture") {
            mscore->addImage(score(), static_cast<HBox*>(e));
            }
      else if (cmd == "frame-text") {
            Text* t = new Text(score());
            t->setTextStyleType(TEXT_STYLE_FRAME);
            t->setParent(e);
            score()->undoAddElement(t);
            score()->select(t, SELECT_SINGLE, 0);
            startEdit(t);
            }
      else if (cmd == "title-text") {
            Text* t = new Text(score());
            t->setTextStyleType(TEXT_STYLE_TITLE);
            t->setParent(e);
            score()->undoAddElement(t);
            score()->select(t, SELECT_SINGLE, 0);
            startEdit(t);
            }
      else if (cmd == "subtitle-text") {
            Text* t = new Text(score());
            t->setTextStyleType(TEXT_STYLE_SUBTITLE);
            t->setParent(e);
            score()->undoAddElement(t);
            score()->select(t, SELECT_SINGLE, 0);
            startEdit(t);
            }
      else if (cmd == "composer-text") {
            Text* t = new Text(score());
            t->setTextStyleType(TEXT_STYLE_COMPOSER);
            t->setParent(e);
            score()->undoAddElement(t);
            score()->select(t, SELECT_SINGLE, 0);
            startEdit(t);
            }
      else if (cmd == "poet-text") {
            Text* t = new Text(score());
            t->setTextStyleType(TEXT_STYLE_POET);
            t->setParent(e);
            score()->undoAddElement(t);
            score()->select(t, SELECT_SINGLE, 0);
            startEdit(t);
            }
      else if (cmd == "insert-hbox") {
            HBox* s = new HBox(score());
            double w = width() - s->leftMargin() * MScore::DPMM - s->rightMargin() * MScore::DPMM;
            s->setBoxWidth(Spatium(w / s->spatium()));
            s->setParent(e);
            score()->undoAddElement(s);
            score()->select(s, SELECT_SINGLE, 0);
            startEdit(s);
            }
      else if (cmd == "picture")
            mscore->addImage(score(), e);
      else if (cmd == "tuplet-props") {
            Tuplet* tuplet;
            QList<Element*> el;
            if (e->type() == NOTE) {
                  tuplet = static_cast<Note*>(e)->chord()->tuplet();
                  el.append(tuplet);
                  }
            else if (e->isChordRest()) {
                  tuplet = static_cast<ChordRest*>(e)->tuplet();
                  el.append(tuplet);
                  }
            else {
                  tuplet = static_cast<Tuplet*>(e);
                  el.append(score()->selection().elements());      // apply to all selected tuplets
                  }
            TupletProperties vp(tuplet);
            if (vp.exec()) {
                  int bracketType = vp.bracketType();
                  int numberType  = vp.numberType();
                  foreach(Element* e, el) {
                        if (e->type() == TUPLET) {
                              Tuplet* tuplet = static_cast<Tuplet*>(e);
                              if (bracketType != tuplet->bracketType())
                                    score()->undoChangeProperty(tuplet, P_BRACKET_TYPE, bracketType);
                              if (numberType != tuplet->numberType())
                                    score()->undoChangeProperty(tuplet, P_NUMBER_TYPE, numberType);
                              }
                        }
                  }
开发者ID:ryanbraganza,项目名称:MuseScore,代码行数:101,代码来源:propertymenu.cpp


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