void Ottava::resetProperty(P_ID id) { switch (id) { case P_ID::OTTAVA_TYPE: return; case P_ID::LINE_WIDTH: setLineWidth(score()->styleS(StyleIdx::ottavaLineWidth)); lineWidthStyle = PropertyStyle::STYLED; break; case P_ID::LINE_STYLE: setLineStyle(Qt::PenStyle(score()->styleI(StyleIdx::ottavaLineStyle))); lineStyleStyle = PropertyStyle::STYLED; break; case P_ID::NUMBERS_ONLY: setNumbersOnly(score()->styleB(StyleIdx::ottavaNumbersOnly)); numbersOnlyStyle = PropertyStyle::STYLED; setOttavaType(_ottavaType); break; default: return TextLine::resetProperty(id); } }
void Ottava::styleChanged() { if (lineWidthStyle == PropertyStyle::STYLED) setLineWidth(score()->styleS(StyleIdx::ottavaLineWidth)); if (lineStyleStyle == PropertyStyle::STYLED) setLineStyle(Qt::PenStyle(score()->styleI(StyleIdx::ottavaLineStyle))); if (numbersOnlyStyle == PropertyStyle::STYLED) setNumbersOnly(score()->styleB(StyleIdx::ottavaNumbersOnly)); setOttavaType(_ottavaType); }
bool Ottava::setProperty(P_ID propertyId, const QVariant& val) { switch (propertyId) { case P_ID::OTTAVA_TYPE: setOttavaType(Type(val.toInt())); break; case P_ID::PLACEMENT: if (val != getProperty(propertyId)) { // reverse hooks setBeginHookHeight(-beginHookHeight()); setEndHookHeight(-endHookHeight()); } TextLine::setProperty(propertyId, val); break; case P_ID::LINE_WIDTH: lineWidthStyle = PropertyStyle::UNSTYLED; TextLine::setProperty(propertyId, val); break; case P_ID::LINE_STYLE: lineStyleStyle = PropertyStyle::UNSTYLED; TextLine::setProperty(propertyId, val); break; case P_ID::NUMBERS_ONLY: setNumbersOnly(val.toBool()); setOttavaType(_ottavaType); numbersOnlyStyle = PropertyStyle::UNSTYLED; break; case P_ID::SPANNER_TICKS: setTicks(val.toInt()); staff()->updateOttava(); break; case P_ID::SPANNER_TICK: setTick(val.toInt()); staff()->updateOttava(); break; default: if (!TextLine::setProperty(propertyId, val)) return false; break; } score()->setLayoutAll(true); return true; }
bool Ottava::setProperty(P_ID propertyId, const QVariant& val) { switch (propertyId) { case P_ID::OTTAVA_TYPE: setOttavaType(OttavaType(val.toInt())); break; case P_ID::LINE_WIDTH: lineWidthStyle = PropertyStyle::UNSTYLED; TextLine::setProperty(propertyId, val); break; case P_ID::LINE_STYLE: lineStyleStyle = PropertyStyle::UNSTYLED; TextLine::setProperty(propertyId, val); break; case P_ID::NUMBERS_ONLY: setNumbersOnly(val.toBool()); setOttavaType(_ottavaType); numbersOnlyStyle = PropertyStyle::UNSTYLED; break; case P_ID::SPANNER_TICK2: staff()->pitchOffsets().remove(tick2()); setTick2(val.toInt()); staff()->updateOttava(this); break; case P_ID::SPANNER_TICK: staff()->pitchOffsets().remove(tick()); setTick(val.toInt()); staff()->updateOttava(this); break; default: if (!TextLine::setProperty(propertyId, val)) return false; break; } score()->setLayoutAll(true); return true; }