fix demo plugins to use newCursor instead of QML elements

This commit is contained in:
lasconic 2013-07-15 17:02:03 +02:00
parent 7423c85951
commit d167ec515c
2 changed files with 2 additions and 10 deletions

View file

@ -30,12 +30,8 @@ MuseScore {
// Apply the given function to all notes in selection // Apply the given function to all notes in selection
// or, if nothing is selected, in the entire score // or, if nothing is selected, in the entire score
Cursor {
id: cursor
score: curScore
}
function applyToNotesInSelection(func) { function applyToNotesInSelection(func) {
var cursor = curScore.newCursor();
cursor.rewind(1); cursor.rewind(1);
var startStaff = cursor.staffIdx; var startStaff = cursor.staffIdx;
cursor.rewind(2); cursor.rewind(2);

View file

@ -21,14 +21,10 @@ MuseScore {
description: qsTr("This plugin names notes") description: qsTr("This plugin names notes")
menuPath: "Plugins.Notes." + qsTr("Note Names") // this does not work, why? menuPath: "Plugins.Notes." + qsTr("Note Names") // this does not work, why?
Cursor {
id: cursor
score: curScore
}
onRun: { onRun: {
if (typeof curScore === 'undefined') if (typeof curScore === 'undefined')
Qt.quit(); Qt.quit();
var cursor = curScore.newCursor();
cursor.rewind(1); cursor.rewind(1);
var startStaff = cursor.staffIdx; var startStaff = cursor.staffIdx;
cursor.rewind(2); cursor.rewind(2);