examples/: implicit capture of this via [=] is deprecated in C++20

Change-Id: I43b04517e9e3a30468c8ce702c9a49968c0ddc4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2023-07-21 20:06:28 +03:00
parent 07c34e4c79
commit 339323b999
2 changed files with 3 additions and 3 deletions

View File

@ -446,7 +446,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel)
if (cborNumberSize(value) != actualSize) if (cborNumberSize(value) != actualSize)
printf(" (overlong)"); printf(" (overlong)");
}; };
auto print = [=](const char *descr, const char *fmt, ...) { auto print = [&](const char *descr, const char *fmt, ...) {
qint64 prevOffset = offset; qint64 prevOffset = offset;
offset = reader.currentOffset(); offset = reader.currentOffset();
if (prevOffset == offset) if (prevOffset == offset)
@ -480,7 +480,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel)
return print(descr, "%a", d); return print(descr, "%a", d);
}; };
auto printString = [=](const char *descr) { auto printString = [&](const char *descr) {
constexpr qsizetype ChunkSizeLimit = std::numeric_limits<int>::max(); constexpr qsizetype ChunkSizeLimit = std::numeric_limits<int>::max();
QByteArray indent(nestingLevel * 2, ' '); QByteArray indent(nestingLevel * 2, ' ');
const char *chunkStr = (reader.isLengthKnown() ? "" : "chunk "); const char *chunkStr = (reader.isLengthKnown() ? "" : "chunk ");

View File

@ -42,7 +42,7 @@ MainWindow::MainWindow(VulkanWindow *vulkanWindow)
pauseButton->setFocusPolicy(Qt::NoFocus); pauseButton->setFocusPolicy(Qt::NoFocus);
connect(quitButton, &QPushButton::clicked, qApp, &QCoreApplication::quit); connect(quitButton, &QPushButton::clicked, qApp, &QCoreApplication::quit);
connect(newButton, &QPushButton::clicked, vulkanWindow, [=] { connect(newButton, &QPushButton::clicked, vulkanWindow, [this, &vulkanWindow] {
vulkanWindow->addNew(); vulkanWindow->addNew();
m_count = vulkanWindow->instanceCount(); m_count = vulkanWindow->instanceCount();
counterLcd->display(m_count); counterLcd->display(m_count);