From fa53849b4a0959ab7bf7295b79fab251b90aec3f Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Jan 2022 07:02:40 +0100 Subject: [PATCH] Editor: prevent using function hint widget while it is deleted Task-number: QTCREATORBUG-26872 Change-Id: I634b488073670476ee3d5b53296e77b6779e5715 Reviewed-by: Reviewed-by: Allan Sandfeld Jensen --- .../texteditor/codeassist/functionhintproposalwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp index 91a00386e14..926ebfde39b 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp @@ -154,7 +154,10 @@ FunctionHintProposalWidget::FunctionHintProposalWidget() connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage); connect(downArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::nextPage); - connect(d->m_popupFrame.data(), &QObject::destroyed, this, &FunctionHintProposalWidget::abort); + connect(d->m_popupFrame.data(), &QObject::destroyed, this, [this](){ + qApp->removeEventFilter(this); + deleteLater(); + }); setFocusPolicy(Qt::NoFocus); }