本文整理汇总了C++中Accidental::setParent方法的典型用法代码示例。如果您正苦于以下问题:C++ Accidental::setParent方法的具体用法?C++ Accidental::setParent怎么用?C++ Accidental::setParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accidental
的用法示例。
在下文中一共展示了Accidental::setParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void TrillSegment::layout()
{
if (staff())
setMag(staff()->mag(tick()));
if (isSingleType() || isBeginType()) {
Accidental* a = trill()->accidental();
if (a) {
a->layout();
a->setMag(a->mag() * .6);
qreal _spatium = spatium();
a->setPos(_spatium * 1.3, -2.2 * _spatium);
a->setParent(this);
}
switch (trill()->trillType()) {
case Trill::Type::TRILL_LINE:
symbolLine(SymId::ornamentTrill, SymId::wiggleTrill);
break;
case Trill::Type::PRALLPRALL_LINE:
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
break;
case Trill::Type::UPPRALL_LINE:
symbolLine(SymId::ornamentBottomLeftConcaveStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
case Trill::Type::DOWNPRALL_LINE:
symbolLine(SymId::ornamentLeftVerticalStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
}
}
else
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
autoplaceSpannerSegment();
}
示例2: layout
void TrillSegment::layout()
{
if (autoplace())
setUserOff(QPointF());
if (staff())
setMag(staff()->mag(tick()));
if (isSingleType() || isBeginType()) {
Accidental* a = trill()->accidental();
if (a) {
a->layout();
a->setMag(a->mag() * .6);
qreal _spatium = spatium();
a->setPos(_spatium * 1.3, -2.2 * _spatium);
a->setParent(this);
}
switch (trill()->trillType()) {
case Trill::Type::TRILL_LINE:
symbolLine(SymId::ornamentTrill, SymId::wiggleTrill);
break;
case Trill::Type::PRALLPRALL_LINE:
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
break;
case Trill::Type::UPPRALL_LINE:
symbolLine(SymId::ornamentBottomLeftConcaveStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
case Trill::Type::DOWNPRALL_LINE:
symbolLine(SymId::ornamentLeftVerticalStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
}
}
else
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
if (parent()) {
qreal yo = score()->styleP(trill()->placeBelow() ? Sid::trillPosBelow : Sid::trillPosAbove);
rypos() = yo;
if (autoplace()) {
qreal minDistance = spatium();
Shape s1 = shape().translated(pos());
if (trill()->placeAbove()) {
qreal d = system()->topDistance(staffIdx(), s1);
if (d > -minDistance)
rUserYoffset() = -d - minDistance;
}
else {
qreal d = system()->bottomDistance(staffIdx(), s1);
if (d > -minDistance)
rUserYoffset() = d + minDistance;
}
}
}
}