diff options
-rw-r--r-- | src/nfc/qnearfieldtarget_android.cpp | 10 | ||||
-rw-r--r-- | src/nfc/qnearfieldtarget_neard_p.h | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/nfc/qnearfieldtarget_android.cpp b/src/nfc/qnearfieldtarget_android.cpp index 26f3d429..30b2eeca 100644 --- a/src/nfc/qnearfieldtarget_android.cpp +++ b/src/nfc/qnearfieldtarget_android.cpp @@ -193,8 +193,9 @@ QNearFieldTarget::RequestId NearFieldTarget::readNdefMessages() QNdefMessage qNdefMessage = QNdefMessage::fromByteArray(ndefMessageQBA); QMetaObject::invokeMethod(this, "ndefMessageRead", Qt::QueuedConnection, Q_ARG(QNdefMessage, qNdefMessage)); - QMetaObject::invokeMethod(this, "requestCompleted", Qt::QueuedConnection, - Q_ARG(QNearFieldTarget::RequestId, requestId)); + QMetaObject::invokeMethod(this, [this, requestId]() { + Q_EMIT this->requestCompleted(requestId); + }, Qt::QueuedConnection); QMetaObject::invokeMethod(this, "ndefMessageRead", Qt::QueuedConnection, Q_ARG(QNdefMessage, qNdefMessage), Q_ARG(QNearFieldTarget::RequestId, requestId)); @@ -273,8 +274,9 @@ QNearFieldTarget::RequestId NearFieldTarget::sendCommand(const QByteArray &comma // Closing connection disconnect(); // IOException at this point does not matter anymore. } - QMetaObject::invokeMethod(this, "requestCompleted", Qt::QueuedConnection, - Q_ARG(QNearFieldTarget::RequestId&, requestId)); + QMetaObject::invokeMethod(this, [this, requestId]() { + Q_EMIT this->requestCompleted(requestId); + }, Qt::QueuedConnection); return requestId; } diff --git a/src/nfc/qnearfieldtarget_neard_p.h b/src/nfc/qnearfieldtarget_neard_p.h index 78dedeeb..053df141 100644 --- a/src/nfc/qnearfieldtarget_neard_p.h +++ b/src/nfc/qnearfieldtarget_neard_p.h @@ -355,8 +355,9 @@ private: QMetaObject::invokeMethod(this, "ndefMessageRead", Qt::QueuedConnection, Q_ARG(QNdefMessage, newNdefMessage)); // the request id in requestCompleted has to match the one created in readNdefMessages - QMetaObject::invokeMethod(this, "requestCompleted", Qt::QueuedConnection, - Q_ARG(QNearFieldTarget::RequestId, m_currentReadRequestId)); + QMetaObject::invokeMethod(this, [this]() { + Q_EMIT this->requestCompleted(this->m_currentReadRequestId); + }, Qt::QueuedConnection); } else { QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QNearFieldTarget::Error, QNearFieldTarget::UnknownError), @@ -394,8 +395,9 @@ private: } QMetaObject::invokeMethod(this, "ndefMessagesWritten", Qt::QueuedConnection); - QMetaObject::invokeMethod(this, "requestCompleted", Qt::QueuedConnection, - Q_ARG(QNearFieldTarget::RequestId, m_currentWriteRequestId)); + QMetaObject::invokeMethod(this, [this]() { + Q_EMIT this->requestCompleted(this->m_currentWriteRequestId); + }, Qt::QueuedConnection); } // invalidate current write request |