diff --git a/qad_widgets/qcodeedit.cpp b/qad_widgets/qcodeedit.cpp index b17696a..d97b096 100644 --- a/qad_widgets/qcodeedit.cpp +++ b/qad_widgets/qcodeedit.cpp @@ -165,6 +165,13 @@ QChar QCodeEdit::pairChar(QChar c) { bool QCodeEdit::eventFilter(QObject * o, QEvent * e) { + if (e->type() == QEvent::Destroy) { + completer.removeEventFilter(this); + textCode->removeEventFilter(this); + textCode->viewport()->removeEventFilter(this); + textLines->viewport()->removeEventFilter(this); + return QWidget::eventFilter(o, e); + } if (textLines) { if (o == textLines->viewport()) { if (e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonRelease ||