fix possible crash on workbench change
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user