summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2021-05-25 17:13:34 +0200
committerIvan Solovev <ivan.solovev@qt.io>2021-05-27 14:27:35 +0200
commit47d54961c7684f75b845dbd3c3ebc276a9d94de8 (patch)
treed2465a1b835cc0d63d89067ebd6f8b509e369471 /examples
parente7f77b79a3d4c238e1835fa29adb095ef9d47f19 (diff)
QtNFC: remove QNearFieldTarget::ndefMessagesWritten signal
ndefMessagesWritten signal basically duplicates the requestCompleted signal, but does not provide a request id parameter to track, which messages were actually written. Given that, the signal is removed. One should now use requestCompleted and check the request id instead. [ChangeLog][QtNFC][QNearFieldTarget] Remove ndefMessagesWritten signal. Use requestCompleted signal instead. Task-number: QTBUG-93854 Change-Id: Ic7f97eabfa83879b0da0cf34310a2982621cf8de Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc2
-rw-r--r--examples/nfc/ndefeditor/mainwindow.cpp14
-rw-r--r--examples/nfc/ndefeditor/mainwindow.h2
3 files changed, 10 insertions, 8 deletions
diff --git a/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc b/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
index eb638200..a8ea4761 100644
--- a/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
+++ b/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
@@ -56,7 +56,7 @@ Tag by calling the method QNearFieldManager::startTargetDetection.
Once the target is detected the MainWindow connects the following
signals to its internal private slots:
QNearFieldTarget::ndefMessageRead, QNearFieldTarget::NdefReadError,
-QNearFieldTarget::ndefMessagesWritten,
+QNearFieldTarget::requestCompleted,
QNearFieldTarget::NdefWriteError and QNearFieldTarget::error
\snippet ndefeditor/mainwindow.cpp QNearFieldTarget detected
diff --git a/examples/nfc/ndefeditor/mainwindow.cpp b/examples/nfc/ndefeditor/mainwindow.cpp
index b4317528..cbb223de 100644
--- a/examples/nfc/ndefeditor/mainwindow.cpp
+++ b/examples/nfc/ndefeditor/mainwindow.cpp
@@ -242,7 +242,7 @@ void MainWindow::targetDetected(QNearFieldTarget *target)
targetError(QNearFieldTarget::NdefReadError, m_request);
break;
case WriteNdef:
- connect(target, &QNearFieldTarget::ndefMessagesWritten, this, &MainWindow::ndefMessageWritten);
+ connect(target, &QNearFieldTarget::requestCompleted, this, &MainWindow::ndefMessageWritten);
connect(target, &QNearFieldTarget::error, this, &MainWindow::targetError);
m_request = target->writeNdefMessages(QList<QNdefMessage>() << ndefMessage());
@@ -287,12 +287,14 @@ void MainWindow::ndefMessageRead(const QNdefMessage &message)
ui->statusBar->clearMessage();
}
-void MainWindow::ndefMessageWritten()
+void MainWindow::ndefMessageWritten(const QNearFieldTarget::RequestId &id)
{
- ui->status->setStyleSheet(QString());
- m_manager->stopTargetDetection();
- m_request = QNearFieldTarget::RequestId();
- ui->statusBar->clearMessage();
+ if (id == m_request) {
+ ui->status->setStyleSheet(QString());
+ m_manager->stopTargetDetection();
+ m_request = QNearFieldTarget::RequestId();
+ ui->statusBar->clearMessage();
+ }
}
void MainWindow::targetError(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id)
diff --git a/examples/nfc/ndefeditor/mainwindow.h b/examples/nfc/ndefeditor/mainwindow.h
index 234efcd2..2e95bca4 100644
--- a/examples/nfc/ndefeditor/mainwindow.h
+++ b/examples/nfc/ndefeditor/mainwindow.h
@@ -91,7 +91,7 @@ private slots:
void targetLost(QNearFieldTarget *target);
void ndefMessageRead(const QNdefMessage &message);
- void ndefMessageWritten();
+ void ndefMessageWritten(const QNearFieldTarget::RequestId &id);
void targetError(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id);
private: