Remove unused code into GUI

This commit is contained in:
andrea
2022-07-11 15:10:25 +02:00
committed by Uwe
parent 094ae93678
commit 3018985f80
47 changed files with 14 additions and 1592 deletions

View File

@@ -132,36 +132,7 @@ 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.
QWidget *w = QApplication::focusWidget();
// For some reason, Qt (5.15) on Windows will remove current focus
// before bringing up a modal dialog.
if (!w)
return false;
while (w) { // don't worry about focus changes internally in the editor
if (w == widget || w == parentEditor->activeEditor)
return false;
// ignore focus change to 3D view or tree view, because, for
// example DlgPropertyLink is implemented as modeless dialog
// to allow selection in 3D and tree view.
if (qobject_cast<MDIView*>(w))
return false;
if (qobject_cast<TreeWidget*>(w))
return false;
w = w->parentWidget();
}
#endif
}
}
return QItemDelegate::eventFilter(o, ev);