From 1dde7d6e816199e4d4fa88637ad4a5bdce30abd9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 9 Sep 2019 14:56:19 +0200 Subject: [PATCH] fix possible crash on workbench change --- src/Gui/TaskView/TaskView.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 }