Plugin API: setting properties before adding an element to a score may work incorrectly

• Sep 25, 2019 - 20:35
Reported version
3.2
Type
Plugins
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
Yes
Project

Based on the report in this forum topic: https://musescore.org/en/node/294805

To reproduce run the following plugin:

import QtQuick 2.0
import MuseScore 3.0
 
MuseScore {
      menuPath: "Plugins.example"
 
      onRun: {
            var cursor = curScore.newCursor();
            cursor.rewind(Cursor.SCORE_START);
 
            var text = newElement(Element.STAFF_TEXT);
            text.text = "example"
            text.offsetX = 1.2;
 
            cursor.add(text);
 
            Qt.quit()
            }
      }

Expected results: X offset of the newly added text element equals to 1.2. Offset property is not styled.
Actual results: X offset of the newly added text element equals to 0 (that is, its style default value). Offset property is marked as styled.


Comments

Fix version
3.3.0