Skip to content

Commit 2dc58eb

Browse files
authored
Merge pull request #28386 from XiaoMigros/pluginapi-subtype
Allow plugin elements to call subtype
2 parents 333b5e3 + cd4eb76 commit 2dc58eb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/engraving/api/v1/elements.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,16 @@ class EngravingItem : public apiv1::ScoreElement
159159
*/
160160
Q_PROPERTY(QRectF bbox READ bbox)
161161

162-
API_PROPERTY(subtype, SUBTYPE)
162+
/**
163+
* Subtype of this element.
164+
* \since MuseScore 4.6
165+
*/
166+
Q_PROPERTY(int subtype READ subtype)
167+
/**
168+
* Unlike the name might suggest, this property no longer returns the subtype and is scarcely used.
169+
* Named 'subtype' prior to MuseScore 4.6
170+
*/
171+
API_PROPERTY(subType, SUBTYPE)
163172
API_PROPERTY_READ_ONLY_T(bool, selected, SELECTED)
164173
API_PROPERTY_READ_ONLY_T(bool, generated, GENERATED)
165174
/**
@@ -410,6 +419,8 @@ class EngravingItem : public apiv1::ScoreElement
410419

411420
QRectF bbox() const;
412421

422+
int subtype() const { return element()->subtype(); }
423+
413424
public:
414425
/// \cond MS_INTERNAL
415426
EngravingItem(mu::engraving::EngravingItem* e = nullptr, Ownership own = Ownership::PLUGIN)

0 commit comments

Comments
 (0)