本文整理汇总了C++中Articulation::width方法的典型用法代码示例。如果您正苦于以下问题:C++ Articulation::width方法的具体用法?C++ Articulation::width怎么用?C++ Articulation::width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articulation
的用法示例。
在下文中一共展示了Articulation::width方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void BarLine::layout()
{
qreal y1, y2;
getY(&y1, &y2);
qreal _spatium = spatium();
qreal dw = score()->styleS(ST_barWidth).val() * _spatium;
qreal dotwidth = symbols[score()->symIdx()][dotSym].width(magS());
switch(subtype()) {
case DOUBLE_BAR:
dw = (score()->styleS(ST_doubleBarWidth) * 2
+ score()->styleS(ST_doubleBarDistance)).val() * _spatium;
break;
case START_REPEAT:
dw += dotwidth + (score()->styleS(ST_endBarWidth)
+ 2 * score()->styleS(ST_endBarDistance)).val() * _spatium;
break;
case END_REPEAT:
dw += dotwidth + (score()->styleS(ST_endBarWidth)
+ 2 * score()->styleS(ST_endBarDistance)).val() * _spatium;
break;
case END_BAR:
dw += (score()->styleS(ST_endBarWidth)
+ score()->styleS(ST_endBarDistance)).val() * _spatium;
break;
case END_START_REPEAT:
dw += 2 * dotwidth + (score()->styleS(ST_barWidth)
+ score()->styleS(ST_endBarWidth)
+ 4 * score()->styleS(ST_endBarDistance)).val() * _spatium;
break;
case BROKEN_BAR:
case NORMAL_BAR:
break;
default:
qDebug("illegal bar line type\n");
break;
}
QRectF r(0.0, y1, dw, y2-y1);
if (score()->styleB(ST_repeatBarTips)) {
// qreal mags = magS();
switch (subtype()) {
case START_REPEAT:
//r |= symbols[brackettipsRightUp].bbox(mags).translated(0, y1);
//r |= symbols[brackettipsRightDown].bbox(mags).translated(0, y2);
break;
case END_REPEAT:
//r |= symbols[brackettipsLeftUp].bbox(mags).translated(0, y1);
//r |= symbols[brackettipsLeftDown].bbox(mags).translated(0, y2);
break;
default:
break;
}
}
foreach(Element* e, _el) {
e->layout();
if (e->type() == ARTICULATION) {
Articulation* a = static_cast<Articulation*>(e);
ArticulationAnchor aa = a->anchor();
qreal distance = 0.5 * _spatium;
qreal topY = y1 - distance;
qreal botY = y2 + distance;
qreal x = width() - (a->width() * .5);
if (aa == A_TOP_STAFF)
a->setPos(QPointF(x, topY));
else if (aa == A_BOTTOM_STAFF)
a->setPos(QPointF(x, botY));
}
}