ClangTools: FilterDialog: Capture by copy

A reference to buttonBox gets vahished after c'tor of FilterDialog
finished. Capture by copy the buttonBox.

Amends b72ae58629

Fixes: QTCREATORBUG-28524
Change-Id: Id6eaf826243e307f26a91c4bd6386cf836bce111
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Jarek Kobus
2022-11-29 20:22:04 +01:00
parent 2f8e962f83
commit 72a01bd00e

View File

@@ -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);
});