Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt6-changes.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qtnfc-changes-qt6.html
6
\title Changes to Qt NFC
7
\ingroup changes-qt-5-to-6
8
\brief Migrate Qt NFC to Qt 6.
9
10
Qt 6 is a result of the conscious effort to make the framework more
11
efficient and easy to use.
12
13
We try to maintain binary and source compatibility for all the public
14
APIs in each release. But some changes were inevitable in an effort to
15
make Qt a better framework.
16
17
In this topic we summarize those changes in Qt NFC, and provide guidance
18
to handle them.
19
20
\section1 New Features and Methods
21
22
\section2 Added \l QNdefRecord::clear()
23
24
Use this method to clear an NDEF record.
25
26
\section2 Added \l QNdefFilter::match()
27
28
Use this method to check if a \l QNdefMessage matches the given filter.
29
The method returns \c true in case of successful match and \c false
30
otherwise.
31
32
\section2 Extended \l QNearFieldTarget::Type
33
34
The enum was extended with two more types:
35
\list
36
\li \l QNearFieldTarget::NfcTagType4A
37
\li \l QNearFieldTarget::NfcTagType4B
38
\endlist
39
40
\section1 Changes in the Features and Methods
41
42
\section2 Renamed QNearFieldManager::isAvailable()
43
44
The \c QNearFieldManager::isAvailable() was renamed to
45
\l QNearFieldManager::isEnabled().
46
47
\section2 Added access method argument to \l QNearFieldManager::isSupported
48
49
The \c accessMethod argument allows to check if a specific feature is
50
supported. This is relevant because different platforms or versions of
51
operating systems can support different options.
52
53
\section2 Added access method argument to \l QNearFieldManager::startTargetDetection
54
55
The \c accessMethod argument allows to scan for NFC tags with the given
56
access method.
57
58
\section2 Changed \l QNdefNfcSmartPosterRecord::typeInfo from \l QByteArray to \l QString
59
60
According to NDEF Smart Poster specification, the type is a UTF-8 formatted
61
string.
62
This affects the \l QNdefNfcSmartPosterRecord::typeInfo() and
63
\l QNdefNfcSmartPosterRecord::setTypeInfo() methods.
64
65
\section2 Updated return type of \l QNdefFilter::appendRecord
66
67
\l QNdefFilter::appendRecord now performs a basic validation of input
68
parameters and returns a boolean value indicating if the record is appended
69
to the filter or not.
70
71
\section1 Removed Features and Methods
72
73
\section2 Removed QNearFieldTarget::url
74
75
The method was never implemented in the existing subclasses of
76
\l QNearFieldTarget.
77
78
\section2 Removed QNearFieldTarget::sendCommands
79
80
In Qt 5, the method was not very helpful because it didn't provide a way to
81
track the results of intermediate commands. Normally, an additional command
82
needs to be sent only when the previous command is successfully executed.
83
84
The correct approach would be to manually create a queue of commands,
85
use \l QNearFieldTarget::sendCommand to send a command and
86
\l QNearFieldTarget::requestCompleted or \l QNearFieldTarget::error to
87
handle the results of each command individually.
88
89
\section2 Removed QNearFieldTarget::keepConnection
90
91
The methods \c QNearFieldTarget::keepConnection() and
92
\c QNearFieldTarget::setKeepConnection() were removed. Keeping the
93
connection is the default behavior for now.
94
95
\section2 Removed QNearFieldTarget::isProcessingCommand
96
97
The method was never implemented and always returned \c false.
98
99
\section2 Made QNearFieldTarget::setResponseForRequest private API
100
101
The method should not be exposed as a public API. Use
102
\l QNearFieldTarget::ndefMessageRead or \l QNearFieldTarget::requestResponse
103
to read the data from an NFC tag.
104
105
\section2 Removed QNearFieldTarget::handleResponse
106
107
The method was removed as it just forwarded the call to
108
\c QNearFieldManager::setResponseForRequest, which became private API.
109
110
\section2 Made QNearFieldTarget::reportError private API
111
112
A \l QNearFieldTarget::error signal can be used instead.
113
114
\section2 Removed QNearFieldTarget::ndefMessagesWritten signal
115
116
The \l QNearFieldTarget::requestCompleted signal is used for both NDEF
117
messages and custom commands. The \c id parameter can be used to check which
118
request is actually completed.
119
120
\section2 Removed QNearFieldManager::(un)registerNdefMessageHandler
121
122
The methods \c QNearFieldTarget::registerNdefMessageHandler and
123
\c QNearFieldTarget::unregisterNdefMessageHandler were removed.
124
125
Use \l QNearFieldTarget::ndefMessageRead() and \l QNdefFilter::match() to
126
detect the NDEF messages and filter the required ones.
127
128
\note The application can still be automatically started once the NDEF Tag
129
is touched. The \l {annotatedurl}{Annotated URL} example shows how to
130
achieve it on Android.
131
132
\section2 Removed QNearFieldManager::TargetAccessModes
133
134
The \c TargetAccessModes enum was removed together with the getter and
135
setter methods (\c QNearFieldManager::setTargetAccessModes() and
136
\c {QNearFieldManager::targetAccessModes()}).
137
138
The feature is not supported on Android and iOS platforms.
139
140
\section2 Removed QNearFieldShareManager and QNearFieldShareTarget
141
142
File sharing via NFC is deprecated on Android in API 29. Other technologies
143
should be used instead.
144
145
\section2 Removed QML API
146
147
The support for QML API is discontinued.
148
149
*/
qtconnectivity
src
nfc
doc
src
qt6-changes.qdoc
Generated on Sat Sep 28 2024 01:05:46 for Qt by
1.12.0