From 72a01bd00e9d03e4c113c61e0d4c76a12fa0be4b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 29 Nov 2022 20:22:04 +0100 Subject: [PATCH] ClangTools: FilterDialog: Capture by copy A reference to buttonBox gets vahished after c'tor of FilterDialog finished. Capture by copy the buttonBox. Amends b72ae58629ec8b274ba25fc2596e74ed937dacb3 Fixes: QTCREATORBUG-28524 Change-Id: Id6eaf826243e307f26a91c4bd6386cf836bce111 Reviewed-by: Alessandro Portale --- src/plugins/clangtools/filterdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangtools/filterdialog.cpp b/src/plugins/clangtools/filterdialog.cpp index c302c86c8ba..3d4e9601570 100644 --- a/src/plugins/clangtools/filterdialog.cpp +++ b/src/plugins/clangtools/filterdialog.cpp @@ -94,7 +94,7 @@ FilterDialog::FilterDialog(const Checks &checks, QWidget *parent) buttonBox, }.attachTo(this); - connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [&] { + connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [=] { const bool hasSelection = !m_view->selectionModel()->selectedRows().isEmpty(); buttonBox->button(QDialogButtonBox::Ok)->setEnabled(hasSelection); });