Skip to content
Igor edited this page Aug 12, 2024 · 2 revisions

Engraving style settings determine how the music is displayed (e.g., page height, bar width, 8va line style, etc.).

Using settings

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 values

For 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.

Adding new settings

Settings are declared in /src/engraving/style/styledef.h and defined in /src/engraving/style/styledef.cpp.

  1. Add your new setting to the Sid enum in /src/engraving/style/styledef.h
  2. Add the default value to /src/engraving/style/styledef.cpp

Exposing settings to users

When these settings are exposed to users, they appear in the Format > Style… menu.

[TODO]

Testing

Translation

Compilation

  1. Set up developer environment
  2. Install Qt and Qt Creator
  3. Get MuseScore's source code
  4. Install dependencies
  5. Compile on the command line
  6. Compile in Qt Creator

Beyond compiling

  1. Find your way around the code
  2. Submit a Pull Request
  3. Fix the CI checks

Misc. development

Architecture general

Audio

Engraving

Extensions

Google Summer of Code

References

Clone this wiki locally