[MusicXML import] Crash caused by unsupported QVariant

• Oct 11, 2018 - 06:44
Reported version
2.3
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Saving a file imported from MusicXML in .mscx or .mscz format sometimes crashes MuseScore with error message "XmlWriter::tag: unsupported type 38 float". Cause is a combination of two things:

1) in file mscore/importmxmlpass1.cpp function updateStyles() style elements lyricsOddFontSize and lyricsEvenFontSize are set to a QVariant(float) instead of QVariant(double)

2) XmlWriter::tag() supports QVariant::Double but does not support QVariant::Float

Changing updateStyles() to use doubles solves the problem (as would supporting QVariant::Float in XmlWriter::tag()


Comments

Implemented option 1) in PR https://github.com/musescore/MuseScore/pull/4023. Chose this as the MusicXML importer is the part of MuseScore using a Variant containing a float.

This specifically affect 3.0, not sure about 2.3.x.

Jojo is right (I was a bit imprecise): QVariant::Float indeed doesn't exist. That doesn't affect the outcome, as Variant does support float and XmlWriter::tag() doesn't, which causes the issue.