Skip to content
Draft
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/scoreelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ qreal ScoreElement::spatium() const
return e->isEngravingItem() ? toEngravingItem(e)->spatium() : e->score()->style().spatium();
}

QQmlListProperty<ScoreElement> ScoreElement::children()
{
return wrapContainerProperty<ScoreElement>(this, e->children());
}

//---------------------------------------------------------
// ScoreElement::get
//---------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions src/engraving/api/v1/scoreelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class EngravingObject;
}

namespace mu::engraving::apiv1 {
class ScoreElement;
//---------------------------------------------------------
// Ownership
/// \cond PLUGIN_API \private \endcond
Expand Down Expand Up @@ -68,6 +69,9 @@ class ScoreElement : public QObject
/// The EID of this element.
/// \since MuseScore 4.6
Q_PROPERTY(QString eid READ eid)
/// The children of this element. Does not include children of children.
/// \since MuseScore 4.7
Q_PROPERTY(QQmlListProperty<apiv1::ScoreElement> children READ children)

Ownership m_ownership;

Expand Down Expand Up @@ -97,6 +101,8 @@ class ScoreElement : public QObject

QString eid() const { return QString::fromStdString(element()->eid().toStdString()); }

QQmlListProperty<apiv1::ScoreElement> children();

QVariant get(mu::engraving::Pid pid) const;
void set(mu::engraving::Pid pid, const QVariant& val);
void reset(mu::engraving::Pid pid);
Expand Down
Loading