summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-01-02 12:17:52 +0100
committerIvan Solovev <ivan.solovev@qt.io>2024-01-05 19:05:55 +0100
commitb55674cbabb6250a415eeba96671a937045e4fd3 (patch)
treefc1e55c24890348b1ac25cfbdce8421ed9b39755
parentddb35dafbcddcac9ffcfc428253b00b096b182ff (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.7 6.6 6.5 Change-Id: Ibaf00fb3c661abcc39b5d758e57ee5a837c0e270 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
-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}