fix possible crash on workbench change

This commit is contained in:
wmayer
2019-09-09 14:56:19 +02:00
parent a073eb6749
commit 1dde7d6e81

View File

@@ -720,6 +720,19 @@ void TaskView::addTaskWatcher(void)
updateWatcher();
#if defined (QSINT_ACTIONPANEL)
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
// Workaround to avoid a crash in Qt. See also
// https://forum.freecadweb.org/viewtopic.php?f=8&t=39187
//
// Notify the button box about a style change so that it can
// safely delete the style animation of its push buttons.
QDialogButtonBox* box = taskPanel->findChild<QDialogButtonBox*>();
if (box) {
QEvent event(QEvent::StyleChange);
QApplication::sendEvent(box, &event);
}
#endif
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
#endif
}