本文整理汇总了C++中StaffType::drawInputStringMarks方法的典型用法代码示例。如果您正苦于以下问题:C++ StaffType::drawInputStringMarks方法的具体用法?C++ StaffType::drawInputStringMarks怎么用?C++ StaffType::drawInputStringMarks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaffType
的用法示例。
在下文中一共展示了StaffType::drawInputStringMarks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
void PositionCursor::paint(QPainter* p)
{
if (!visible())
return;
QPointF points[3];
qreal h = _sv->score()->spatium() * 2;
qreal x = _rect.left();
qreal y = _rect.top();
switch(_type) {
case CursorType::LOOP_IN: // draw a right-pointing triangle
{
qreal tx = x - 1.0;
p->setPen(QPen(_color, 2.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p->drawLine(x, y, x, _rect.bottom());
points[0] = QPointF(tx, y);
points[1] = QPointF(tx, y + h);
points[2] = QPointF(tx + h, y + h * .5);
p->setBrush(_color);
p->drawConvexPolygon(points, 3);
}
break;
case CursorType::LOOP_OUT: // draw a left-pointing triangle
p->setPen(QPen(_color, 2.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p->drawLine(x, y, x, _rect.bottom());
points[0] = QPointF(x, y);
points[1] = QPointF(x, y + h);
points[2] = QPointF(x - h, y + h * .5);
p->setBrush(_color);
p->drawConvexPolygon(points, 3);
break;
default: // fill the rectangle and add TAB string marks, if required
p->fillRect(_rect, color());
if (_sv->score()->noteEntryMode()) {
int track = _sv->score()->inputTrack();
if (track >= 0) {
Staff* staff = _sv->score()->staff(track2staff(track));
StaffType* staffType = staff->staffType();
if (staffType && staffType->group() == StaffGroup::TAB)
staffType->drawInputStringMarks(p, _sv->score()->inputState().string(),
track2voice(track), _rect);
}
}
break;
}
}