Fixed crash when changing UI style (fusion, ...)

* use overloaded function with string directly
* Qt::QueuedConnection

The old version looked correct to me, nevertheless it did always crash
This commit is contained in:
Klaus Basan
2019-04-05 19:09:15 +02:00
committed by Mat Sutcliffe
parent 9fd782af71
commit 77acffb73e
2 changed files with 10 additions and 2 deletions

View File

@@ -1086,7 +1086,15 @@ namespace BlackGui
}
else
{
QApplication::setStyle(QStyleFactory::create(widgetStyle));
QStyle *style = QApplication::setStyle(currentWidgetStyle);
if (style)
{
CLogMessage(this).info(u"Changed style to '%1', req.: '%2'") << style->objectName() << currentWidgetStyle;
}
else
{
CLogMessage(this).error(u"Unable to set requested style '%1'") << currentWidgetStyle;
}
}
}
}