Editor: prevent using function hint widget while it is deleted

Task-number: QTCREATORBUG-26872
Change-Id: I634b488073670476ee3d5b53296e77b6779e5715
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
David Schulz
2022-01-17 07:02:40 +01:00
parent e1f45507c5
commit fa53849b4a

View File

@@ -154,7 +154,10 @@ FunctionHintProposalWidget::FunctionHintProposalWidget()
connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage); connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage);
connect(downArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::nextPage); 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); setFocusPolicy(Qt::NoFocus);
} }