Saving score properties causes a crash
Reported version
4.x-dev
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
Steps to reproduce:
1) Create or open a score
2) Go to File -> Score Properties
3) Change any value and save
4) Pop.
This bug was introduced during the Fixed accessibility for score properties dialog commit. It is because the code is assuming that all properties are labelled by a QLineEdit and the previous change has changed them to a QLabel.
I have a candidate fix for it - I'm just working out how I create a test (I'm new to this open source project - Hi!)
Hopefully I'll have it by the end of the day.
Fix version
4.0.0
Comments
'exception' means 'crash' , doesn't it?
In reply to 'exception' means 'crash' ,… by Jojo-Schmitz
Hi - yes - see attached.
It's because there is a static cast of a QLabel to a QLineEdit in scoreproperties.cpp. I've done a bit of refactor so I can create a test but failing a little bit. Shall I create a branch and then post on the forums for help?
I've refactored the getting of the name value pairs for the score properties into a new class which can then be instanced easily and put under test - but I'm failing to instance a QLabel in my unit test (it itself crashed!) - I suspect it is because I don't really understand Qt very well? The initialisation of QLabel crashes in Qt5Core.
In reply to Hi - yes - see attached. It… by jonnymoo73
Ok - sussed it I think. GMain was instancing a QGuiApplication. If we use QApplication (which extends QGuiApplication) instead as per https://doc.qt.io/qt-5/qguiapplication.html then I can instance QLabels (as long as "new" than to create them on the heap rather than the stack - otherwise they can be out of sync). Pull request on its way....
https://github.com/musescore/MuseScore/pull/10211
Fixed in branch master, commit c81344850c
Fix #328003 score property crash - check if label is a label or a line edit
Fixed in branch master, commit 8696c0a961
_Merge pull request #10266 from jonnymoo/328003-ScorePropertyCrash
Fix #328003 score property crash_
Automatically closed -- issue fixed for 2 weeks with no activity.