From 75da888bc5949b657adb1fe7d2b35e84ae3a55e9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 16 Mar 2022 08:47:56 +0100 Subject: [PATCH] Gui: fixes #6583: FreeCAD 0.20 crashes when attempting to change template in TechDraw For more details see also: https://forum.freecadweb.org/viewtopic.php?p=579530#p579530 --- src/Gui/propertyeditor/PropertyItemDelegate.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Gui/propertyeditor/PropertyItemDelegate.cpp b/src/Gui/propertyeditor/PropertyItemDelegate.cpp index bb4a3714df..7f49049c46 100644 --- a/src/Gui/propertyeditor/PropertyItemDelegate.cpp +++ b/src/Gui/propertyeditor/PropertyItemDelegate.cpp @@ -132,6 +132,14 @@ bool PropertyItemDelegate::eventFilter(QObject *o, QEvent *ev) if (widget && parentEditor && parentEditor->activeEditor && widget != parentEditor->activeEditor) { +#if 1 + // All the attempts to ignore the focus-out event has been approved to not work + // reliably because there are still cases that cannot be handled. + // So, the best for now is to always ignore this event. + // See https://forum.freecadweb.org/viewtopic.php?p=579530#p579530 why this is not + // possible. + return false; +#else // We event filter child QAbstractButton and QLabel of an editor, // which requires special focus change in order to not mess up with // QItemDelegate's logic. @@ -153,6 +161,7 @@ bool PropertyItemDelegate::eventFilter(QObject *o, QEvent *ev) return false; w = w->parentWidget(); } +#endif } } return QItemDelegate::eventFilter(o, ev);