Fix crash.

This commit is contained in:
Roman Telezhynskyi 2021-07-01 16:54:49 +03:00
parent 391a721d84
commit 7ea984f194
2 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,6 @@
# Valentina 0.7.49 (unreleased)
- Fix crash.
# Valentina 0.7.48 June 29, 2021
- [smart-pattern/valentina#129] Incorrect behavior of empty arc and elliptical arc.
- Parsing formulas with not canonical math symbols.

View File

@ -125,14 +125,17 @@ void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
void VGraphicsSimpleTextItem::setEnabled(bool enabled)
{
QGraphicsSimpleTextItem::setEnabled(enabled);
const QPalette palet = this->scene()->palette();
if (enabled)
if (this->scene())
{
setBrush(palet.brush(QPalette::Active, QPalette::Text));
}
else
{
setBrush(palet.brush(QPalette::Disabled, QPalette::Text));
const QPalette palet = this->scene()->palette();
if (enabled)
{
setBrush(palet.brush(QPalette::Active, QPalette::Text));
}
else
{
setBrush(palet.brush(QPalette::Disabled, QPalette::Text));
}
}
}