MuseScore Plugins  3.5
Plugins API for MuseScore
Public Member Functions | Properties | List of all members
Selection Class Reference
Inheritance diagram for Selection:
Inheritance graph
[legend]
Collaboration diagram for Selection:
Collaboration graph
[legend]

Public Member Functions

Q_INVOKABLE bool select (Ms::PluginAPI::Element *e, bool add=false)
 Selects the given element. More...
 
Q_INVOKABLE bool selectRange (int startTick, int endTick, int startStaff, int endStaff)
 Selects a range in a score. More...
 
Q_INVOKABLE bool deselect (Ms::PluginAPI::Element *e)
 Deselects the given element. More...
 
Q_INVOKABLE bool clear ()
 Clears the selection. More...
 

Properties

QQmlListProperty< Ms::PluginAPI::Elementelements
 Current GUI selections for the score. More...
 
bool isRange
 Whether this selection covers a range of a score, as opposed to a list of distinct elements. More...
 
Ms::PluginAPI::Segment startSegment
 Start segment of selection, included. More...
 
Ms::PluginAPI::Segment endSegment
 End segment of selection, excluded. More...
 
int startStaff
 First staff of selection, included. More...
 
int endStaff
 End staff of selection, included. More...
 

Detailed Description

Since
MuseScore 3.3

Member Function Documentation

◆ clear()

bool clear ( )

Clears the selection.

Returns
true on success, false if selection cannot be changed, e.g. due to the ongoing operation on a score (like dragging elements).
Since
MuseScore 3.5

◆ deselect()

bool deselect ( Ms::PluginAPI::Element e)

Deselects the given element.

Returns
true on success, false if selection cannot be changed, e.g. due to the ongoing operation on a score (like dragging elements).
Since
MuseScore 3.5

◆ select()

bool select ( Ms::PluginAPI::Element e,
bool  add = false 
)

Selects the given element.

At this point only a limited number of element types is supported, like notes, rests and most of text elements.

Parameters
eelement to select
addif true, appends an element to already existing selection. If false (default), deselects all other elements and selects this element.
Returns
true on success, false if selection cannot be changed, e.g. due to the ongoing operation on a score (like dragging elements) or incorrect arguments to this function.
Since
MuseScore 3.5

◆ selectRange()

bool selectRange ( int  startTick,
int  endTick,
int  startStaff,
int  endStaff 
)

Selects a range in a score.

Parameters
startTickstart tick to be included in selection
endTickend tick of selection, excluded from selection
startStaffstart staff index, included in selection
endStaffend staff index, excluded from seleciton
Returns
true on success, false if selection cannot be changed, e.g. due to the ongoing operation on a score (like dragging elements) or incorrect arguments to this function.
Since
MuseScore 3.5

Property Documentation

◆ elements

QQmlListProperty<Ms::PluginAPI::Element> elements
read

Current GUI selections for the score.

Since
MuseScore 3.3

◆ endSegment

Ms::PluginAPI::Segment endSegment
read

End segment of selection, excluded.

This property is valid only for range selection.

Since
MuseScore 3.5
See also
isRange

◆ endStaff

int endStaff
read

End staff of selection, included.

This property is valid only for range selection.

Since
MuseScore 3.5
See also
isRange

◆ isRange

bool isRange
read

Whether this selection covers a range of a score, as opposed to a list of distinct elements.

Since
MuseScore 3.5

◆ startSegment

Ms::PluginAPI::Segment startSegment
read

Start segment of selection, included.

This property is valid only for range selection.

Since
MuseScore 3.5
See also
isRange

◆ startStaff

int startStaff
read

First staff of selection, included.

This property is valid only for range selection.

Since
MuseScore 3.5
See also
isRange

The documentation for this class was generated from the following files: