Chord symbol root disappears upon editing in part
Windows 7, GIT commit: 22807df
1) new score
2) enter chord symbol "G7"
3) file / parts
4) new all
5) ok
6) visit part
7) double click chord symbol to edit
8) Esc
Result: only "7" is displayed
I can see this is because the part at that point has a chordList but there is nothing in the renderListBase or renderListRoot members. When the chordList is copied to the parts, not everything is making it. I actually thought this was working last summer when I redid the chord symbol rendering, and in fact I thought I specifically remember adding a copy constructor at some point, but maybe I'm thinking of something else.
Comments
Actually, on further investigation, I think this is a duplicate of:
#24631: General style settings not propagated from scores to parts
So it's not that some fields aren't being copied when the chord list is copied from score to parent - it's that the chord list is not being copied at all, because it's part of the style, and style isn't being copied, either.
In the present version both problems are not reproducable, all works correct.
Really? It still fails for me. Are you sure you are following the steps exactly as shown above?
For #24631: General style settings not propagated from scores to parts, be sure to read [http://musescore.org/en/node/24631#comment-95466|comment #2]. Text styles do now propagate, but general style and chord lists do not.
Also, be sure you don't have a "Style for part" set - this will of course mask any issues with style inheritance.
I cloned and built the code from yesterday. No defaults, just MuseScore as it comes.
Yes, but rebuilding from source doesn't alter any preference settings you've made in the past. So again, to be totally clear: you don't have a "Style for part" set, and you followed the steps to reproduce above precisely? I think you should also be sure not to have a "Style for score" set, as this could also be a variable based on my analysis.
How about for #24631: General style settings not propagated from scores to parts - did you use the steps in the initial report or the steps in my later response?
Tracing through this in the code, I really can't see how it could possibly work, so I'm pretty sure it will turn out you either have one of the Style preferences set or are missing something in following my steps.
I had debugged it far enough when I first reported it to see why the score was getting a default style rather a copy of the score's style. MScore::defaultStyleForParts (currently mscore.cpp, line 191), when called from Score::Score(Score* parent) (score.cpp line 381), is finding _defaultStyleForParts already set even though the option is *not* set; this appeared to be a copy of _defaultStyle.
I'm currently in the middle of a full build which takes a while on my system, so I can't actually debug further, but just looking at the code, it seems obvious why this happening.
_defaultStyleForParts is initialized in MScore::Init - which is to say, before any score is even loaded - to a copy of _defaultStyle. And it's never modified again. So MScore::defaultStyleForParts is always reporting a default style for parts exists, and it's just a copy of defaultStyle. And thus, Score::Score(Score* parent) is never getting the opportunity to propagate its own style.
I don't understand how the text style *is* getting propagated, actually. Probably an issue with how deeply some of the style copies are performed.
But I suspect that simply replacing the initialization of defaultStyleForParts with 0 would fix the problem for now.
I can now verify that simply eliminating the initialization of _defaultStyleForParts, so it starts off 0, fixes these problems. Parts then inherit the score style, including its chordList, so newly entered or edited chord symbols render correctly.
But in light of the outstanding request for style for parts to be a per-score parameter and all the ensuing discussion, I think rather than submit a PR for this, we should decide how we want to solve this "for real" - see #24030: Style for Parts.
See http://musescore.org/en/node/24732#comment-95773. It appears neither of us likely actually knew if we had a style for parts set, because the dialog was broken. I am still investigating.
My proposed fix for #24631: General style settings not propagated from scores to parts will fix this as well:
https://github.com/musescore/MuseScore/pull/709
PR merged so it's fixed.
Automatically closed -- issue fixed for 2 weeks with no activity.