diff --git a/examples/corelib/serialization/cbordump/main.cpp b/examples/corelib/serialization/cbordump/main.cpp index 4c02abd304..de31a588bd 100644 --- a/examples/corelib/serialization/cbordump/main.cpp +++ b/examples/corelib/serialization/cbordump/main.cpp @@ -446,7 +446,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel) if (cborNumberSize(value) != actualSize) printf(" (overlong)"); }; - auto print = [=](const char *descr, const char *fmt, ...) { + auto print = [&](const char *descr, const char *fmt, ...) { qint64 prevOffset = offset; offset = reader.currentOffset(); if (prevOffset == offset) @@ -480,7 +480,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel) return print(descr, "%a", d); }; - auto printString = [=](const char *descr) { + auto printString = [&](const char *descr) { constexpr qsizetype ChunkSizeLimit = std::numeric_limits::max(); QByteArray indent(nestingLevel * 2, ' '); const char *chunkStr = (reader.isLengthKnown() ? "" : "chunk "); diff --git a/examples/vulkan/hellovulkancubes/mainwindow.cpp b/examples/vulkan/hellovulkancubes/mainwindow.cpp index e84436bb1d..5a41b54152 100644 --- a/examples/vulkan/hellovulkancubes/mainwindow.cpp +++ b/examples/vulkan/hellovulkancubes/mainwindow.cpp @@ -42,7 +42,7 @@ MainWindow::MainWindow(VulkanWindow *vulkanWindow) pauseButton->setFocusPolicy(Qt::NoFocus); connect(quitButton, &QPushButton::clicked, qApp, &QCoreApplication::quit); - connect(newButton, &QPushButton::clicked, vulkanWindow, [=] { + connect(newButton, &QPushButton::clicked, vulkanWindow, [this, &vulkanWindow] { vulkanWindow->addNew(); m_count = vulkanWindow->instanceCount(); counterLcd->display(m_count);