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


C++ Spatium函数代码示例

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


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

示例1: SLine

LyricsLine::LyricsLine(Score* s)
  : SLine(s)
      {
      setFlags(0);

      setGenerated(true);           // no need to save it, as it can be re-generated
      setDiagonal(false);
      setLineWidth(Spatium(LYRICS_DASH_DEFAULT_LINE_THICKNESS));
      setAnchor(Spanner::Anchor::SEGMENT);
      _nextLyrics = nullptr;
      }
开发者ID:barichd,项目名称:MuseScore,代码行数:11,代码来源:lyrics.cpp

示例2: hairpin

void HairpinSegment::editDrag(const EditData& ed)
      {
      if (ed.curGrip == Grip::APERTURE) {
            qreal newHeight = hairpin()->hairpinHeight().val() + ed.delta.y()/spatium()/.5;
            if (newHeight < 0.5)
                  newHeight = 0.5;
            hairpin()->setHairpinHeight(Spatium(newHeight));
            triggerLayout();
            }
      LineSegment::editDrag(ed);
      }
开发者ID:shredpub,项目名称:MuseScore,代码行数:11,代码来源:hairpin.cpp

示例3: Spatium

StaffType::StaffType()
      {
      _lines           = 5;
      _stepOffset      = 0;
      _lineDistance    = Spatium(1);

      _genClef         = true;      // create clef at beginning of system
      _showBarlines    = true;
      _slashStyle      = false;     // do not show stems
      _genTimesig      = true;      // whether time signature is shown or not
      }
开发者ID:Archer90,项目名称:MuseScore,代码行数:11,代码来源:stafftype.cpp

示例4: Spatium

TextStyleData::TextStyleData()
      {
      family                 = "FreeSerif";
      size                   = 10.0;
      bold                   = false;
      italic                 = false;
      underline              = false;
      hasFrame               = false;
      sizeIsSpatiumDependent = false;
      frameWidth             = Spatium(0);
      paddingWidth           = Spatium(0);
      frameWidthMM           = 0.0;
      paddingWidthMM         = 0.0;
      frameRound             = 25;
      frameColor             = MScore::defaultColor;
      circle                 = false;
      systemFlag             = false;
      foregroundColor        = Qt::black;
      backgroundColor        = QColor(255, 255, 255, 0);
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:20,代码来源:textstyle.cpp

示例5: point

qreal Bracket::width() const
      {
      qreal w;
      if (bracketType() == BRACKET_BRACE)
            w = point(score()->styleS(ST_akkoladeWidth) + score()->styleS(ST_akkoladeBarDistance));
      else if (bracketType() == BRACKET_NORMAL)
            w = point(score()->styleS(ST_bracketWidth) + score()->styleS(ST_bracketDistance));
      else if (bracketType() == BRACKET_SQUARE)
            w = point(score()->styleS(ST_staffLineWidth) + Spatium(0.5));
      return w;
      }
开发者ID:CFrei,项目名称:MuseScore,代码行数:11,代码来源:bracket.cpp

示例6: setPercFromDlg

void EditStaffType::setPercFromDlg(StaffTypePercussion * st)
{
      st->setName(name->text());
      st->setLines(lines->value());
      st->setLineDistance(Spatium(lineDistance->value()));
      st->setGenClef(genClef->isChecked());
      st->setShowBarlines(showBarlines->isChecked());
      st->setGenTimesig(genTimesig->isChecked());
      st->setGenKeysig(genKeysigPercussion->isChecked());
      st->setShowLedgerLines(showLedgerLinesPercussion->isChecked());
      st->setSlashStyle(stemlessPercussion->isChecked());
}
开发者ID:BlueMockingbird,项目名称:MuseScore,代码行数:12,代码来源:editstafftype.cpp

示例7: SLine

Glissando::Glissando(Score* s)
  : SLine(s)
      {
      setFlags(ElementFlag::MOVABLE | ElementFlag::SELECTABLE);

      _glissandoType = Type::STRAIGHT;
      _text          = "gliss.";
      _showText      = true;
      setDiagonal(true);
      setLineWidth(Spatium(GLISS_DEFAULT_LINE_TICKNESS));
      setAnchor(Spanner::Anchor::NOTE);
      }
开发者ID:jpirie,项目名称:MuseScore,代码行数:12,代码来源:glissando.cpp

示例8: if

TextStyle TextProp::textStyle() const
      {
      if (curUnit == 0)
            ts.setOffsetType(OffsetType::ABS);
      else if (curUnit == 1)
            ts.setOffsetType(OffsetType::SPATIUM);
      ts.setBold(fontBold->isChecked());
      ts.setItalic(fontItalic->isChecked());
      ts.setUnderline(fontUnderline->isChecked());
      ts.setSize(fontSize->value());
      QFont f = fontSelect->currentFont();
      ts.setFamily(f.family());
      ts.setXoff(xOffset->value() / ((ts.offsetType() == OffsetType::ABS) ? INCH : 1.0));
      ts.setYoff(yOffset->value() / ((ts.offsetType() == OffsetType::ABS) ? INCH : 1.0));
      ts.setFrameColor(frameColor->color());
      ts.setForegroundColor(color->color());
      ts.setBackgroundColor(bgColor->color());
      ts.setFrameWidth(Spatium(frameWidth->value()));
      ts.setPaddingWidth(Spatium(paddingWidth->value()));
      ts.setCircle(circleButton->isChecked());
      ts.setFrameRound(frameRound->value());
      ts.setHasFrame(frame->isChecked());
      ts.setSystemFlag(systemFlag->isChecked());
      ts.setSizeIsSpatiumDependent(sizeIsSpatiumDependent->isChecked());

      Align a = 0;
      if (alignHCenter->isChecked())
            a |= AlignmentFlags::HCENTER;
      else if (alignRight->isChecked())
            a |= AlignmentFlags::RIGHT;

      if (alignVCenter->isChecked())
            a |= AlignmentFlags::VCENTER;
      else if (alignBottom->isChecked())
            a |= AlignmentFlags::BOTTOM;
      else if (alignBaseline->isChecked())
            a |= AlignmentFlags::BASELINE;
      ts.setAlign(a);
      return ts;
      }
开发者ID:FryderykChopin,项目名称:MuseScore,代码行数:40,代码来源:textprop.cpp

示例9: TextLineBase

Ottava::Ottava(Score* s)
   : TextLineBase(s, ElementFlag::ON_STAFF | ElementFlag::MOVABLE)
      {
      _ottavaType = OttavaType::OTTAVA_8VA;
      setBeginTextPlace(PlaceText::LEFT);
      setContinueTextPlace(PlaceText::LEFT);
      setEndHookType(HookType::HOOK_90);
      setLineVisible(true);
      setBeginHookHeight(Spatium(.0));
      setEndText("");

      initElementStyle(&ottavaStyle);
      }
开发者ID:mmuman,项目名称:MuseScore,代码行数:13,代码来源:ottava.cpp

示例10: point

qreal Bracket::width() const
      {
      qreal w = 0;
      if (bracketType() == BracketType::BRACE)
            w = point(score()->styleS(StyleIdx::akkoladeWidth) + score()->styleS(StyleIdx::akkoladeBarDistance));
      else if (bracketType() == BracketType::NORMAL)
            w = point(score()->styleS(StyleIdx::bracketWidth) + score()->styleS(StyleIdx::bracketDistance));
      else if (bracketType() == BracketType::SQUARE)
            w = point(score()->styleS(StyleIdx::staffLineWidth) + Spatium(0.5));
      else if (bracketType() == BracketType::LINE)
            w = point(0.67f * score()->styleS(StyleIdx::bracketWidth) + score()->styleS(StyleIdx::bracketDistance));
      return w;
      }
开发者ID:HerbertYu,项目名称:MuseScore,代码行数:13,代码来源:bracket.cpp

示例11: TextLineBase

TextLine::TextLine(Score* s)
   : TextLineBase(s)
      {
      initElementStyle(&textLineStyle);

      setPlacement(Placement::ABOVE);
      setBeginText("");
      setContinueText("");
      setEndText("");
      setBeginTextOffset(QPointF(0,0));
      setContinueTextOffset(QPointF(0,0));
      setEndTextOffset(QPointF(0,0));
      setLineVisible(true);

      setBeginHookType(HookType::NONE);
      setEndHookType(HookType::NONE);
      setBeginHookHeight(Spatium(1.5));
      setEndHookHeight(Spatium(1.5));

      resetProperty(Pid::BEGIN_TEXT_PLACE);
      resetProperty(Pid::CONTINUE_TEXT_PLACE);
      resetProperty(Pid::END_TEXT_PLACE);
      }
开发者ID:frankvanbever,项目名称:MuseScore,代码行数:23,代码来源:textline.cpp

示例12: switch

bool Hairpin::setProperty(P_ID id, const QVariant& v)
      {
      switch (id) {
            case P_ID::HAIRPIN_TEXTLINE:
                _useTextLine = v.toBool();
                break;
            case P_ID::HAIRPIN_CIRCLEDTIP:
                _hairpinCircledTip = v.toBool();
                break;
            case P_ID::HAIRPIN_TYPE:
                  _hairpinType = Type(v.toInt());
                  setGenerated(false);
                  break;
            case P_ID::VELO_CHANGE:
                  _veloChange = v.toInt();
                  break;
            case P_ID::DYNAMIC_RANGE:
                  _dynRange = Dynamic::Range(v.toInt());
                  break;
            case P_ID::LINE_WIDTH:
                  lineWidthStyle = PropertyStyle::UNSTYLED;
                  TextLine::setProperty(id, v);
                  break;
            case P_ID::HAIRPIN_HEIGHT:
                  hairpinHeightStyle = PropertyStyle::UNSTYLED;
                  _hairpinHeight = Spatium(v.toDouble());
                  break;
            case P_ID::HAIRPIN_CONT_HEIGHT:
                  hairpinContHeightStyle = PropertyStyle::UNSTYLED;
                  _hairpinContHeight = Spatium(v.toDouble());
                  break;
            default:
                  return TextLine::setProperty(id, v);
            }
      score()->setLayoutAll(true);
      return true;
      }
开发者ID:sidchatterjee,项目名称:MuseScore,代码行数:37,代码来源:hairpin.cpp

示例13: foreach

void Hairpin::read(XmlReader& e)
      {
      foreach(SpannerSegment* seg, spannerSegments())
            delete seg;
      spannerSegments().clear();

      int id = e.intAttribute("id", -1);
      e.addSpanner(id, this);

      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "subtype")
                  _hairpinType = Type(e.readInt());
            else if (tag == "lineWidth") {
                  setLineWidth(Spatium(e.readDouble()));
                  lineWidthStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "hairpinHeight") {
                  setHairpinHeight(Spatium(e.readDouble()));
                  hairpinHeightStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "hairpinContHeight") {
                  setHairpinContHeight(Spatium(e.readDouble()));
                  hairpinContHeightStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "hairpinCircledTip")
                  _hairpinCircledTip = e.readInt();
            else if (tag == "veloChange")
                  _veloChange = e.readInt();
            else if (tag == "dynType")
                  _dynRange = Dynamic::Range(e.readInt());
            else if (tag == "useTextLine")
                  _useTextLine = e.readInt();
            else if (!TextLine::readProperties(e))
                  e.unknown();
            }
      }
开发者ID:sidchatterjee,项目名称:MuseScore,代码行数:37,代码来源:hairpin.cpp

示例14: switch

QVariant TextLineBase::propertyDefault(P_ID id) const
      {
      switch (id) {
            case P_ID::CONTINUE_TEXT:
            case P_ID::BEGIN_TEXT:
            case P_ID::END_TEXT:
                  return QString("");
            case P_ID::BEGIN_TEXT_PLACE:
            case P_ID::CONTINUE_TEXT_PLACE:
            case P_ID::END_TEXT_PLACE:
                  return int(PlaceText::LEFT);
            case P_ID::BEGIN_HOOK_TYPE:
            case P_ID::END_HOOK_TYPE:
                  return int(HookType::NONE);
            case P_ID::BEGIN_HOOK_HEIGHT:
            case P_ID::END_HOOK_HEIGHT:
                  return Spatium(1.5);
            case P_ID::BEGIN_FONT_FACE:
            case P_ID::CONTINUE_FONT_FACE:
            case P_ID::END_FONT_FACE:
                  return QString("FreeSerif");
            case P_ID::BEGIN_FONT_SIZE:
            case P_ID::CONTINUE_FONT_SIZE:
            case P_ID::END_FONT_SIZE:
                  return 10.0;
            case P_ID::BEGIN_FONT_BOLD:
            case P_ID::BEGIN_FONT_ITALIC:
            case P_ID::BEGIN_FONT_UNDERLINE:
            case P_ID::CONTINUE_FONT_BOLD:
            case P_ID::CONTINUE_FONT_ITALIC:
            case P_ID::CONTINUE_FONT_UNDERLINE:
            case P_ID::END_FONT_BOLD:
            case P_ID::END_FONT_ITALIC:
            case P_ID::END_FONT_UNDERLINE:
                  return false;
            case P_ID::BEGIN_TEXT_OFFSET:
            case P_ID::CONTINUE_TEXT_OFFSET:
            case P_ID::END_TEXT_OFFSET:
                  return QPointF();
            case P_ID::BEGIN_TEXT_ALIGN:
            case P_ID::CONTINUE_TEXT_ALIGN:
            case P_ID::END_TEXT_ALIGN:
                  return int(Align::LEFT);
            case P_ID::LINE_VISIBLE:
                  return true;
            default:
                  return SLine::propertyDefault(id);
            }
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:49,代码来源:textlinebase.cpp

示例15: SLine

TextLine::TextLine(Score* s)
   : SLine(s)
      {
      _beginText         = 0;
      _continueText      = 0;

      _beginHookHeight   = Spatium(1.5);
      _endHookHeight     = Spatium(1.5);
      _beginHook         = false;
      _endHook           = false;
      _beginHookType     = HOOK_90;
      _endHookType       = HOOK_90;

      _lineWidth         = Spatium(0.15);
      _lineStyle         = Qt::SolidLine;
      _beginTextPlace    = PLACE_LEFT;
      _continueTextPlace = PLACE_LEFT;
      _lineColor         = Qt::black;

      _beginSymbol       = noSym;
      _continueSymbol    = noSym;
      _endSymbol         = noSym;
      _sp                = 0;
      }
开发者ID:UIKit0,项目名称:mscoreserver,代码行数:24,代码来源:textline.cpp


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