explicit capture for lamda

ccache_for_windows
Bret Curtis 3 years ago
parent 58e794414a
commit 4b742dd461

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

Loading…
Cancel
Save