summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-01-02 12:17:52 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-01-06 01:37:37 +0000
commit23bdae7d62c5ee04f48eaa0616c9367f22bd1e74 (patch)
treeec94998d382af6732bf42cf79b186745f272594d
parent618e56cc2ce8a27cd67aae50472435951c763ded (diff)
NdefEditor: do not clear the existing message before reading
The read operation can be cancelled, or might fail for some reason. In this case, the user does not expect the existing entries to be deleted, so do not clear the message before reading. If the read is successful, the existing message is replaced by the new one, so no action is required here. Update the example documentation to clarify this behavior. Amends 115b4d947adf90a706f76de831f34960e3c62a9c. Fixes: QTBUG-120410 Pick-to: 6.5 Change-Id: Ibaf00fb3c661abcc39b5d758e57ee5a837c0e270 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> (cherry picked from commit b55674cbabb6250a415eeba96671a937045e4fd3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ee3e3cfc26ce9d9af2b1b8dd6f960514a0b20b55)
-rw-r--r--examples/nfc/ndefeditor/MainWindow.qml1
-rw-r--r--examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc7
2 files changed, 7 insertions, 1 deletions
diff --git a/examples/nfc/ndefeditor/MainWindow.qml b/examples/nfc/ndefeditor/MainWindow.qml
index 0dc5ee46..d32540fb 100644
--- a/examples/nfc/ndefeditor/MainWindow.qml
+++ b/examples/nfc/ndefeditor/MainWindow.qml
@@ -204,7 +204,6 @@ ApplicationWindow {
}
function readTag() {
- messageModel.clearMessage()
window.targetDetectedAction = MainWindow.ReadMessage
nfcManager.startTargetDetection()
communicationOverlay.title = qsTr("Read Tag")
diff --git a/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc b/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
index d93b8d5a..3ce6bc1e 100644
--- a/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
+++ b/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
@@ -11,6 +11,13 @@ The NDEF Editor example reads and writes NFC Data Exchange Format
(NDEF) messages to NFC Forum Tags. NDEF messages can be composed by
adding text and URI records. Records can be deleted by swiping them to the left.
+Press \b {Write to Tag} to write the records to an NFC tag.
+
+Press \b {Read Tag} to read the contents of an NFC tag. A successful read of an
+NFC tag replaces the manually added records with the NDEF message from the tag.
+If the read operation was cancelled or failed, the NDEF message remains
+unchanged.
+
\image ndefeditor.png
\sa {Qt NFC}