diff --git a/src/Gui/TaskView/TaskView.cpp b/src/Gui/TaskView/TaskView.cpp index 2a85b41470..94f5363b65 100644 --- a/src/Gui/TaskView/TaskView.cpp +++ b/src/Gui/TaskView/TaskView.cpp @@ -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(); + if (box) { + QEvent event(QEvent::StyleChange); + QApplication::sendEvent(box, &event); + } +#endif + taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme()); #endif }