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. Amends115b4d947a. Fixes: QTBUG-120410 Pick-to: 6.5 Change-Id: Ibaf00fb3c661abcc39b5d758e57ee5a837c0e270 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> (cherry picked from commitb55674cbab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commitee3e3cfc26)
This commit is contained in:
parent
618e56cc2c
commit
23bdae7d62
|
|
@ -204,7 +204,6 @@ ApplicationWindow {
|
|||
}
|
||||
|
||||
function readTag() {
|
||||
messageModel.clearMessage()
|
||||
window.targetDetectedAction = MainWindow.ReadMessage
|
||||
nfcManager.startTargetDetection()
|
||||
communicationOverlay.title = qsTr("Read Tag")
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue