a lot of Score::setLayoutAll() calls seem excessive & unnecessary to me, but I don't really know the code

• Jan 2, 2019 - 16:39

A lot of calls to setLayoutAll seem unenecesary, as when they're called the whole score needs to be relaid out...but I thought the big plus of 3.0 was not having to do this for most edits. I'm guessing a lot of these calls are just to be on the safe side of correctness? I'm looking over the list of all times it is called...and I'm noting my quick thoughts...but let me know if I'm off base:

bracket.cpp 300 16 in Bracket::endEdit()
bracketItem.cpp 59 16 Bracket::endEdit(EditData& ed)
- seems probably necessary, cause brackets could change the width of every system

score()->setLayoutAll(); cursor.cpp 197 16 Cursor::add(Element* s)
- so for key sig and time sig I would think only need to relayout from measure prior to the sig change up until the next sig change???
- but for all (most?) other elements wouldn't setLayout its tick be sufficient?

duration.cpp 193 28 DurationElement::setProperty(Pid propertyId, const QVariant& v)
- there is even a message "TODO: do we really need to re-layout all here?" (from dmitiro)...I think only need to setLayout for current tick again.

figuredbass.cpp 706 16 FiguredBassItem::setProperty(Pid propertyId, const QVariant& v)
- seems current tick would be sufficient

glissando.cpp 659 16 Glissando::setProperty(Pid propertyId, const QVariant& v)
- wouldn't the tick of the start of the glissando and the tick of the end of the glissando be sufficient?

keysig.cpp 568 16 KeySig::setProperty(Pid propertyId, const QVariant& v)
- again only meas before key sig till next key sig be sufficient?

layoutbreak.cpp 263 16 LayoutBreak::setProperty(Pid propertyId, const QVariant& v)
- I can see if add or remove a layoutbreak, then would want to redo layout from previous break up till next break. But if just changing some properties of the layout (like the PAUSE) then I see no reason to redo layout, or if at most the current and maybe next measure.

lyrics.cpp 467 16 Lyrics::endEdit(EditData& ed)
- wouldn't it just be the current tick?

lyricsline.cpp 316 16 LyricsLine::setProperty(Pid propertyId, const QVariant& v)
marker.cpp 266 16 Marker::setProperty(Pid propertyId, const QVariant& v)
- wouldn't it just be the current tick?

measure.cpp 1544 28 Measure::drop(EditData& data) case SPACER
- would it just be from measure below the spacer?

measurebase.cpp 146 34 MeasureBase::add(Element* e) case LayoutBreak::SECTION
measurebase.cpp 182 34 MeasureBase::remove(Element* el) case LayoutBreak::SECTION
- wouldn't it be from previous break to next break?

measurebase.cpp 361 16 MeasureBase::setProperty(Pid id, const QVariant& value)
-wouldn't it just be current measure and maybe next measure?

part.cpp 619 16 Part::setProperty(Pid id, const QVariant& property)
- I don't think need any relayout when setting non-visual properties (like volume), but for something like Pid::VISIBLE then yes this would be one of the few cases that would necessitate a full relayout

excerpt.cpp 280 14 Excerpt::createExcerpt(Excerpt* excerpt)
- This would only necessitate a layout of the newly-generated part score.

cmd.cpp 3528 7 Score::cmdRelayout()
score.cpp 1274 7 Score::styleChanged()
score.cpp 2123 7 Score::appendScore()
score.cpp 2565 7 Score::sortStaves(QList& dst)
- Obviously yes would do relayout of all...one of the few cases where makes sense.

Anyway, please let me know if I'm way off base...this is just my quick thoughts without thinking too much.

Do you still have an unanswered question? Please log in first to post your question.