Debugger: Fix MSVC warning

sourcefileshandler.cpp:127: warning: C4573: the usage of 'QObject::connect' requires the compiler to capture 'this' but the current default capture mode does not allow it

Change-Id: Ic8ab7de11a91727dffac91d37b1b82e7ea933b65
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Orgad Shaneh
2018-11-11 15:30:07 +02:00
committed by Orgad Shaneh
parent 0f6fcd09de
commit 8ab67ef24e

View File

@@ -121,7 +121,7 @@ bool SourceFilesHandler::setData(const QModelIndex &idx, const QVariant &data, i
QModelIndex index = idx.sibling(idx.row(), 0); QModelIndex index = idx.sibling(idx.row(), 0);
QString name = index.data().toString(); QString name = index.data().toString();
auto addAction = [menu](const QString &display, bool on, const std::function<void()> &onTriggered) { auto addAction = [this, menu](const QString &display, bool on, const std::function<void()> &onTriggered) {
QAction *act = menu->addAction(display); QAction *act = menu->addAction(display);
act->setEnabled(on); act->setEnabled(on);
QObject::connect(act, &QAction::triggered, onTriggered); QObject::connect(act, &QAction::triggered, onTriggered);