1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

explicit capture for lamda

This commit is contained in:
Bret Curtis 2022-02-24 16:01:40 +01:00
parent 58e794414a
commit 4b742dd461

View File

@ -14,7 +14,7 @@ TableHeaderMouseEventHandler::TableHeaderMouseEventHandler(DragRecordTable * par
{ {
header.setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu); header.setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
connect( connect(
&header, &QHeaderView::customContextMenuRequested, [=](const QPoint & position) { showContextMenu(position); }); &header, &QHeaderView::customContextMenuRequested, [this](const QPoint & position) { showContextMenu(position); });
header.viewport()->installEventFilter(this); header.viewport()->installEventFilter(this);
} }
@ -52,7 +52,7 @@ QMenu & TableHeaderMouseEventHandler::createContextMenu()
action->setChecked(!table.isColumnHidden(i)); action->setChecked(!table.isColumnHidden(i));
menu->addAction(action); menu->addAction(action);
connect(action, &QAction::triggered, [=]() { connect(action, &QAction::triggered, [this, &action, &i]() {
table.setColumnHidden(i, !action->isChecked()); table.setColumnHidden(i, !action->isChecked());
action->setChecked(!action->isChecked()); action->setChecked(!action->isChecked());
action->toggle(); action->toggle();