Style settings - musescore/MuseScore GitHub Wiki
Engraving style settings determine how the music is displayed (e.g., page height, bar width, 8va line style, etc.).
If you're working in /src/engraving, you need to import the style header file:
#include "style/style.h"Then, as long as the class inherits from EngravingObject (which it probably does), you can access a specific settings value with:
score()->styleS(Sid idx); // for spatium values as a spatium
score()->styleP(Sid idx); // for spatium values as a qreal
score()->styleSt(Sid idx); // for QString values
score()->styleB(Sid idx); // for boolean values
score()->styleD(Sid idx); // for qreal values
score()->styleI(Sid idx); // for integer valuesFor instance, to get the staff line width as a qreal, you'd use:
score()->styleP(Sid::staffLineWidth)You can discover all style settings in /src/engraving/style/styledef.h.
Settings are declared in /src/engraving/style/styledef.h and defined in /src/engraving/style/styledef.cpp.
- Add your new setting to the
Sidenum in/src/engraving/style/styledef.h - Add the default value to
/src/engraving/style/styledef.cpp
When these settings are exposed to users, they appear in the Format > Style… menu.
[TODO]