Windows version 2.02
start with empty score
1) Enter a note
2) Add a dynamic to this note i.e. p
3) Modify size of p or anything else in context menu
4) Press "reset to style" button in inspector
Nothing happens!
This command "reset to style" works correctly in the context menu.
See also
//musescore.org/en/node/93906
Comments
The problem comes from the fact that the SIGNAL(clicked()) of t.resetToStyle is not connected to a slot during the creation of the InspectorDynamic, after line 859 (mapSignals();) of inspector.cpp:
https://github.com/musescore/MuseScore/blob/master/mscore/inspector/ins…
the instruction
connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle()));
is missing, as well as the definition of the slot Ms::InspectorDynamic::resetToStyle().
An example is shown for the inspectorText, here:
https://github.com/musescore/MuseScore/blob/master/mscore/inspector/ins…
here:
https://github.com/musescore/MuseScore/blob/master/mscore/inspector/ins…
and here:
https://github.com/musescore/MuseScore/blob/master/mscore/inspector/ins…
The same bug probably also affects each inspector which contains an inspectorText, such as the InspectorTempoText.
Thanks for the investigation! I was going to look at this later, and was expecting it would turn out to a problem with the implementation of the reset function, not a matter of it never getting called in the first place. Do you want to do the fix?
I could do the fix by defining a reset function for dynamics, tempotext, etc. , but maybe it would be better to unify the reset functions of these text elements to the inspectorText reset function.
The problem is that I don't know really how to do it. I tried to reference to the function of InspectorText, but I found that the prefix Ms::InspectorDynamic was automatically added in front of the function called by the slot. Maybe we could define a reset function in the InspectorDynamic which is an alias for the reset function of the InspectorText, but I don't know how this can be done.
What about moving resetToStyle from InpectorText to MuseScore::resetToStyle? It has the inspector, so it should be able to do it. Then we just need to add the connect() at the right places?
Thank you lasconic, I think bringing the function to a higher level element is the key.
I moved it to the inspectorBase, from which the inspector classes are derived, and then linked the slot to the signal for the text elements I found in the code.
Proposed PR:
https://github.com/musescore/MuseScore/pull/2344
Fixed in branch master, commit 1887941dfe
fix #93946 : reset text to style in inspector not working for dynamics
Fixed in branch master, commit 36240c47f5
Merge pull request #2344 from AntonioBL/resetToStyle
fix #93946 : reset text to style in inspector not working for dynamics
Fixed in branch 2.0.3, commit 9a6d2fe6fb
fix #93946 : reset text to style in inspector not working for dynamics
Automatically closed -- issue fixed for 2 weeks with no activity.