Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/engraving/api/v1/elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ bool System::show(int staffIdx)
return ss ? ss->show() : false;
}

void System::setHideStaffIfEmpty(int staffIdx, int hide)
{
system()->score()->cmdSetHideStaffIfEmptyOverride(static_cast<staff_idx_t>(staffIdx), system(), AutoOnOff(hide));
}

void System::setIsLocked(bool locked)
{
if (locked == isLocked()) {
Expand Down
6 changes: 6 additions & 0 deletions src/engraving/api/v1/elements.h
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,12 @@ class System : public EngravingItem
/// This can differ from \ref Staff.show (e.g. due to 'hide when empty' rules).
/// \param staffIdx staff number
Q_INVOKABLE bool show(int staffIdx);
/// Override the staff default behaviour for hiding when empty.
/// \param staffIdx staff number
/// \param hide controls the new hiding behaviour.
/// One of PluginAPI::PluginAPI::AutoOnOff values.
/// \since MuseScore 4.7
Q_INVOKABLE void setHideStaffIfEmpty(int staffIdx, int hide);
};

//---------------------------------------------------------
Expand Down
Loading