1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
Origin: backport, commit:443ead70ac77c655095a67bfc0978145fda0c5de
Author: Matt McClinch <mattmcclinch@gmail.com>
Description: Fix #303619: MuseScore crashing when entering font name
Resolves: https://musescore.org/en/node/303619.
.
Passing an empty string to QWidget::setStyleSheet() causes the widget's
current style sheet to be removed, thus causing the widget's style to be
inherited from its parent. This creates a problem in QComboBox::showPopup(),
where it becomes possible that a pointer to a QStyle object could used after
the object itself has been destroyed. A style sheet of " " can be used to
override any previous style sheet without invalidating the current QStyle
object.
--- a/mscore/inspector/inspectorBase.cpp
+++ b/mscore/inspector/inspectorBase.cpp
@@ -278,8 +278,8 @@ void InspectorBase::checkDifferentValues
}
QColor c(preferences.globalStyle == MuseScoreStyleType::DARK ? Qt::yellow : Qt::blue);
- // ii.w->setStyleSheet(valuesAreDifferent ? QString("* { color: %1 }").arg(MScore::selectColor[0].name()) : "");
- ii.w->setStyleSheet(valuesAreDifferent ? QString("* { color: %1 }").arg(c.name()) : "");
+ // ii.w->setStyleSheet(valuesAreDifferent ? QString("* { color: %1 }").arg(MScore::selectColor[0].name()) : " ");
+ ii.w->setStyleSheet(valuesAreDifferent ? QString("* { color: %1 }").arg(c.name()) : " ");
}
//deal with reset if only one element, or if values are the same
@@ -293,12 +293,12 @@ void InspectorBase::checkDifferentValues
reset = false;
}
else if (styledValue == PropertyStyle::UNSTYLED) {
- ii.w->setStyleSheet("");
+ ii.w->setStyleSheet(" ");
reset = true;
}
else {
reset = !isDefault(ii);
- ii.w->setStyleSheet("");
+ ii.w->setStyleSheet(" ");
}
if (ii.r)
ii.r->setEnabled(reset);
@@ -306,7 +306,7 @@ void InspectorBase::checkDifferentValues
else {
if (ii.r)
ii.r->setEnabled(true);
- ii.w->setStyleSheet("");
+ ii.w->setStyleSheet(" ");
}
}
|