summaryrefslogtreecommitdiffstats
path: root/src/nfc/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nfc/doc')
-rw-r--r--src/nfc/doc/qtnfc.qdocconf25
-rw-r--r--src/nfc/doc/snippets/doc_src_qtnfc.cpp82
-rw-r--r--src/nfc/doc/snippets/doc_src_qtnfc.qml65
-rw-r--r--src/nfc/doc/snippets/foorecord.cpp124
-rw-r--r--src/nfc/doc/snippets/foorecord.h78
-rw-r--r--src/nfc/doc/snippets/main.cpp51
-rw-r--r--src/nfc/doc/snippets/nfc.cpp51
-rw-r--r--src/nfc/doc/snippets/snippets.pro13
-rw-r--r--src/nfc/doc/src/examples.qdoc42
-rw-r--r--src/nfc/doc/src/nfc-android.qdoc91
-rw-r--r--src/nfc/doc/src/nfc-cpp.qdoc45
-rw-r--r--src/nfc/doc/src/nfc-features.qdoc64
-rw-r--r--src/nfc/doc/src/nfc-index.qdoc122
-rw-r--r--src/nfc/doc/src/nfc-overview.qdoc166
-rw-r--r--src/nfc/doc/src/nfc-pcsc.qdoc34
-rw-r--r--src/nfc/doc/src/nfc-qml.qdoc43
-rw-r--r--src/nfc/doc/src/qt6-changes.qdoc149
17 files changed, 445 insertions, 800 deletions
diff --git a/src/nfc/doc/qtnfc.qdocconf b/src/nfc/doc/qtnfc.qdocconf
index e4f10f0e..10aede7f 100644
--- a/src/nfc/doc/qtnfc.qdocconf
+++ b/src/nfc/doc/qtnfc.qdocconf
@@ -15,18 +15,11 @@ qhp.QtNfc.virtualFolder = qtnfc
qhp.QtNfc.indexTitle = Qt NFC
qhp.QtNfc.indexRoot =
-qhp.QtNfc.filterAttributes = qtnfc $QT_VERSION qtrefdoc
-qhp.QtNfc.customFilters.Qt.name = QtNfc $QT_VERSION
-qhp.QtNfc.customFilters.Qt.filterAttributes = qtnfc $QT_VERSION
-qhp.QtNfc.subprojects = overviews classes qml examples
+qhp.QtNfc.subprojects = overviews classes examples
qhp.QtNfc.subprojects.classes.title = C++ Classes
qhp.QtNfc.subprojects.classes.indexTitle = Qt NFC C++ Classes
qhp.QtNfc.subprojects.classes.selectors = class fake:headerfile
qhp.QtNfc.subprojects.classes.sortPages = true
-qhp.QtNfc.subprojects.qml.title = QML Types
-qhp.QtNfc.subprojects.qml.indexTitle = Qt NFC QML Types
-qhp.QtNfc.subprojects.qml.selectors = fake:headerfile
-qhp.QtNfc.subprojects.qml.sortPages = true
qhp.QtNfc.subprojects.overviews.title = Overviews
qhp.QtNfc.subprojects.overviews.indexTitle = Qt NFC Overview
qhp.QtNfc.subprojects.overviews.selectors = fake:page,group,module
@@ -36,20 +29,22 @@ qhp.QtNfc.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtnfc/qtnfc.tags
-depends += qtcore qtdoc
+depends += qtcore qtwidgets qtdoc qmake qtcmake
-headerdirs += .. \
- ../../imports/nfc
+headerdirs += ..
-sourcedirs += .. \
- ../../imports/nfc \
+sourcedirs += ..
exampledirs += ../../../examples/nfc \
snippets/
-
imagedirs += images
+manifestmeta.highlighted.names = \
+ "QtNfc/Annotated URL"
+
navigation.landingpage = "Qt NFC"
navigation.cppclassespage = "Qt NFC C++ Classes"
-navigation.qmltypespage = "Qt NFC QML Types"
+
+# Enforce zero documentation warnings
+warninglimit = 0
diff --git a/src/nfc/doc/snippets/doc_src_qtnfc.cpp b/src/nfc/doc/snippets/doc_src_qtnfc.cpp
deleted file mode 100644
index 760d65fd..00000000
--- a/src/nfc/doc/snippets/doc_src_qtnfc.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QObject>
-//! [include]
-#include <QtNfc/QNearFieldManager>
-//! [include]
-#include <QtNfc/QNdefMessage>
-
-//! [namespace]
-QT_USE_NAMESPACE
-//! [namespace]
-
-class MyClass : public QObject
-{
- Q_OBJECT
-public:
- MyClass() : QObject()
- {
-//formatting adjusted to improve usage in docs
-//! [handleNdefMessage]
-QNearFieldManager *manager = new QNearFieldManager(this);
-manager->registerNdefMessageHandler(this,
- SLOT(handleNdefMessage(QNdefMessage,QNearFieldTarget*)));
-//! [handleNdefMessage]
- }
-
-public Q_SLOTS:
- void handleNdefMessage(QNdefMessage,QNearFieldTarget*)
- {
- }
-};
-
-#include "doc_src_qtnfc.moc"
-
diff --git a/src/nfc/doc/snippets/doc_src_qtnfc.qml b/src/nfc/doc/snippets/doc_src_qtnfc.qml
deleted file mode 100644
index e7a45e89..00000000
--- a/src/nfc/doc/snippets/doc_src_qtnfc.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [import]
-import QtNfc 5.12
-//! [import]
-
-Item {
-//! [QML register for messages]
- NearField {
- filter: [ NdefFilter { type: "U"; typeNameFormat: NdefRecord.NfcRtd; minimum: 1; maximum: 1 } ]
- orderMatch: false
-
- onMessageRecordsChanged: displayMessage()
- }
-//! [QML register for messages]
-}
diff --git a/src/nfc/doc/snippets/foorecord.cpp b/src/nfc/doc/snippets/foorecord.cpp
deleted file mode 100644
index 4fecd712..00000000
--- a/src/nfc/doc/snippets/foorecord.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foorecord.h"
-#include <qndefrecord.h>
-
-//! [Declare foo record]
-Q_DECLARE_NDEFRECORD(QQmlNdefFooRecord, QNdefRecord::ExternalRtd, "com.example:f")
-//! [Declare foo record]
-
-//! [createFooRecord]
-static inline QNdefRecord createFooRecord()
-{
- QNdefRecord foo;
- foo.setTypeNameFormat(QNdefRecord::ExternalRtd);
- foo.setType("com.example:f");
- foo.setPayload(QByteArray(sizeof(int), char(0)));
- return foo;
-}
-//! [createFooRecord]
-
-//! [copyFooRecord]
-static inline QNdefRecord copyFooRecord(const QNdefRecord &record)
-{
- if (record.typeNameFormat() != QNdefRecord::ExternalRtd)
- return createFooRecord();
- if (record.type() != "com.example:f")
- return createFooRecord();
-
- return record;
-}
-//! [copyFooRecord]
-
-//! [Constructors]
-QQmlNdefFooRecord::QQmlNdefFooRecord(QObject *parent)
-: QQmlNdefRecord(createFooRecord(), parent)
-{
-}
-
-QQmlNdefFooRecord::QQmlNdefFooRecord(const QNdefRecord &record, QObject *parent)
-: QQmlNdefRecord(copyFooRecord(record), parent)
-{
-}
-//! [Constructors]
-
-QQmlNdefFooRecord::~QQmlNdefFooRecord()
-{
-}
-
-int QQmlNdefFooRecord::foo() const
-{
- QByteArray payload = record().payload();
-
- int value = payload.at(0) << 24 |
- payload.at(1) << 16 |
- payload.at(2) << 8 |
- payload.at(3) << 0;
-
- return value;
-}
-
-void QQmlNdefFooRecord::setFoo(int value)
-{
- if (foo() == value)
- return;
-
- QByteArray payload;
- payload[0] = (value >> 24) & 0xff;
- payload[1] = (value >> 16) & 0xff;
- payload[2] = (value >> 8) & 0xff;
- payload[3] = (value >> 0) & 0xff;
-
- QNdefRecord r = record();
- r.setPayload(payload);
- setRecord(r);
- emit fooChanged();
-}
diff --git a/src/nfc/doc/snippets/foorecord.h b/src/nfc/doc/snippets/foorecord.h
deleted file mode 100644
index c2501287..00000000
--- a/src/nfc/doc/snippets/foorecord.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FOORECORD_H
-#define FOORECORD_H
-
-#include <qqmlndefrecord.h>
-
-QT_USE_NAMESPACE
-
-//! [Foo declaration]
-class QQmlNdefFooRecord : public QQmlNdefRecord
-{
- Q_OBJECT
-
- Q_PROPERTY(int foo READ foo WRITE setFoo NOTIFY fooChanged)
-
-public:
- explicit QQmlNdefFooRecord(QObject *parent = 0);
- Q_INVOKABLE QQmlNdefFooRecord(const QNdefRecord &record, QObject *parent = 0);
- ~QQmlNdefFooRecord();
-
- int foo() const;
- void setFoo(int value);
-
-signals:
- void fooChanged();
-};
-//! [Foo declaration]
-
-#endif // FOORECORD_H
diff --git a/src/nfc/doc/snippets/main.cpp b/src/nfc/doc/snippets/main.cpp
index 6f2bb0d7..fb6724d5 100644
--- a/src/nfc/doc/snippets/main.cpp
+++ b/src/nfc/doc/snippets/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
int main(int /*argc*/, char ** /*argv*/)
{
diff --git a/src/nfc/doc/snippets/nfc.cpp b/src/nfc/doc/snippets/nfc.cpp
index 82297682..a1192bec 100644
--- a/src/nfc/doc/snippets/nfc.cpp
+++ b/src/nfc/doc/snippets/nfc.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtNfc/qndefrecord.h>
#include <QtNfc/qndefnfctextrecord.h>
diff --git a/src/nfc/doc/snippets/snippets.pro b/src/nfc/doc/snippets/snippets.pro
deleted file mode 100644
index 437782e4..00000000
--- a/src/nfc/doc/snippets/snippets.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = nfc_cppsnippet
-QT = core
-#! [project modification]
-QT += nfc
-#! [project modification]
-
-SOURCES += main.cpp \
- doc_src_qtnfc.cpp \
- nfc.cpp \
- foorecord.cpp
-
-HEADERS += foorecord.h
diff --git a/src/nfc/doc/src/examples.qdoc b/src/nfc/doc/src/examples.qdoc
index 1eb410e3..a126763e 100644
--- a/src/nfc/doc/src/examples.qdoc
+++ b/src/nfc/doc/src/examples.qdoc
@@ -1,32 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\ingroup all-examples
\page nfc-examples.html
\title Qt NFC Examples
\brief Examples for the Qt NFC module.
@@ -46,18 +21,5 @@ in their own documentation, but they are also accessible from here.
\li \l{ndefeditor}{NDEF Editor}
\li Create new or modify existing NDEF messages on NFC Forum Tags.
\endtable
-
-\section2 QML Examples
-\table 80%
- \header
- \li Example
- \li Description
- \row
- \li \l{corkboard} {CorkBoard}
- \li Displays NDEF text tags on a corkboard.
- \row
- \li \l{poster}{QML Poster}
- \li Displays URLs stored on NFC Forum Tags.
-\endtable
*/
diff --git a/src/nfc/doc/src/nfc-android.qdoc b/src/nfc/doc/src/nfc-android.qdoc
index d28f78ee..e2ca5401 100644
--- a/src/nfc/doc/src/nfc-android.qdoc
+++ b/src/nfc/doc/src/nfc-android.qdoc
@@ -1,29 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 BasysKom GmbH
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 BasysKom GmbH
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\ingroup connectivity-nfc
@@ -33,13 +10,18 @@
\title Qt NFC on Android
\brief Notes on Nfc for Android.
-\section1 Automatically launching NDEF message handlers on Android
-Android, the registration of NDEF message handlers is done via the
-\l{http://developer.android.com/guide/topics/manifest/manifest-intro.html}{Android manifest file}.
-This means the application has to provide an AndroidManifest.xml file with proper
-\l{http://developer.android.com/guide/topics/connectivity/nfc/nfc.html#manifest}{NFC intent-filter.}
+\section1 Automatically Launching NDEF Message Handlers on Android
-\code
+Android provides the possibility to automatically launch the application when
+touching the NDEF tag.
+
+This can be achieved by providing an
+\l {https://developer.android.com/guide/topics/manifest/manifest-intro.html}
+{Android manifest file} (AndroidManifest.xml) with proper
+\l{https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#manifest}
+{NFC intent-filter}.
+
+\badcode
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
@@ -47,23 +29,36 @@ This means the application has to provide an AndroidManifest.xml file with prope
</intent-filter>
\endcode
-When the application is started it has to register an message handler with
-\l {QNearFieldManager::}{registerNdefMessageHandler()}
-The first NDEF message arriving in the handler is the message that started the application.
-See the \l {corkboard}{CorkBoard} application for an example.
+With this intent-filter enabled, the application will be automatically started
+once the NDEF NFC tag is touched.
+
+\note It's important to design your application in such a way that all the GUI
+is connected to the NFC classes before the target detection is actually started.
+Otherwise it will be impossible to show the information from the tag that caused
+application startup.
+
+\note It's important to touch the tag long enough for the application to start
+and read the information. If the tag is lost during application startup, no data
+will be available, and the tag needs to be touched again.
+
+See \l {annotatedurl}{Annotated URL} application as an example.
+
+\section2 Supported Tag Types
-\section2 Note:
Supported tag types in Android are
-\l{http://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_NDEF_DISCOVERED}{NDEF_DISCOVERED}
-and
-\l{http://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_TECH_DISCOVERED}{ACTION_TAG_DISCOVERED}
-with
-\l{http://developer.android.com/reference/android/nfc/tech/TagTechnology.html}{TagTechnology}
-NdefFormatable or Ndef.
-If the application register other types in the
-\l{http://developer.android.com/guide/topics/manifest/manifest-intro.html}{Android manifest file}
-the application will be started, but the tag will never get delivered to the handler.
-The handler should be registered as early as possible. If the application has not registered a handler, the application
-will be started every time a new tag is in range and the Android device end up running multiple instances of the application.
+\l {https://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_NDEF_DISCOVERED}
+{ACTION_NDEF_DISCOVERED},
+\l {https://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_TAG_DISCOVERED}
+{ACTION_TAG_DISCOVERED} and
+\l {https://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_TECH_DISCOVERED}
+{ACTION_TECH_DISCOVERED} with
+\l {https://developer.android.com/reference/android/nfc/tech/TagTechnology.html}
+{TagTechnology} \e NdefFormatable or \e Ndef.
+
+If the application registers other types in the
+\l {https://developer.android.com/guide/topics/manifest/manifest-intro.html}
+{Android manifest file}, the application will be started, but the tag will never
+be processed.
+
*/
diff --git a/src/nfc/doc/src/nfc-cpp.qdoc b/src/nfc/doc/src/nfc-cpp.qdoc
index 00fb8aa5..0fef1d6b 100644
--- a/src/nfc/doc/src/nfc-cpp.qdoc
+++ b/src/nfc/doc/src/nfc-cpp.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QtNfc
\ingroup modules
+\qtcmakepackage Nfc
\qtvariable nfc
\title Qt NFC C++ Classes
@@ -35,9 +13,18 @@
The \l{Qt NFC} C++ API enables an application to access NFC Forum Tags.
-To use the C++ library in your application, add the following configuration
-option to your \c .pro file:
+\include module-use.qdocinc using qt module
+
+\badcode
+find_package(Qt6 REQUIRED COMPONENTS Nfc)
+target_link_libraries(mytarget PRIVATE Qt::Nfc)
+\endcode
+
+\include module-use.qdocinc building with qmake
+
+\badcode
+QT += nfc
+\endcode
-\snippet snippets.pro project modification
*/
diff --git a/src/nfc/doc/src/nfc-features.qdoc b/src/nfc/doc/src/nfc-features.qdoc
new file mode 100644
index 00000000..65c31f04
--- /dev/null
+++ b/src/nfc/doc/src/nfc-features.qdoc
@@ -0,0 +1,64 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qtnfc-features.html
+\title Supported NFC Features
+\ingroup connectivity-nfc
+\inmodule QtNfc
+\brief Summary of supported NFC features on different platforms.
+
+Qt NFC provides two options for reading and writing the data. These options are
+reflected in the \l {QNearFieldTarget::}{AccessMethod} enum.
+
+\list
+ \li \l {QNearFieldTarget::}{NdefAccess} - using NDEF messages via
+ \l {QNearFieldTarget::}{readNdefMessages()} and
+ \l {QNearFieldTarget::}{writeNdefMessages()}.
+ \li \l {QNearFieldTarget::}{TagTypeSpecificAccess} - sending custom commands
+ using \l {QNearFieldTarget::}{sendCommand()} and getting the results via
+ \l {QNearFieldTarget::}{requestResponse()}.
+\endlist
+
+\l {QNearFieldTarget::}{TagTypeSpecificAccess} implies that the
+user might need to send different data based on the NFC Tag Type. Tag types
+recognized by Qt NFC are defined in the \l {QNearFieldTarget::}{Type} enum.
+
+Qt NFC support for different access methods and tag types varies depending on
+the platform. The table below shows currently supported subsets of features
+for every platform.
+
+\table
+ \header
+ \li Platform
+ \li Recognized Tag Types
+ \li NDEF Support
+ \li Tag Specific Access
+ \row
+ \li \l {Qt NFC on Android}{Android}
+ \li All from the \l {QNearFieldTarget::}{Type} enum
+ \li Yes
+ \li Yes
+ \row
+ \li iOS
+ \li \list
+ \li \l {QNearFieldTarget::}{NfcTagType4}
+ \li \l {QNearFieldTarget::}{NfcTagType4A}
+ \li \l {QNearFieldTarget::}{NfcTagType4B}
+ \li \l {QNearFieldTarget::}{ProprietaryTag}
+ \endlist
+ \li No
+ \li Yes - for supported tag types
+ \row
+ \li Linux, Windows, macOS
+
+ (implemented using \l {PC/SC in Qt NFC}{PC/SC})
+ \li \list
+ \li \l {QNearFieldTarget::}{NfcTagType4}
+ \li \l {QNearFieldTarget::}{ProprietaryTag}
+ \endlist
+ \li Yes - for \l {QNearFieldTarget::}{NfcTagType4}
+ \li Yes - for \l {QNearFieldTarget::}{ProprietaryTag}
+\endtable
+
+*/
diff --git a/src/nfc/doc/src/nfc-index.qdoc b/src/nfc/doc/src/nfc-index.qdoc
index 21f775a6..662fea09 100644
--- a/src/nfc/doc/src/nfc-index.qdoc
+++ b/src/nfc/doc/src/nfc-index.qdoc
@@ -1,30 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtnfc-index.html
@@ -34,55 +10,42 @@
The NFC API provides connectivity between NFC enabled devices.
-Currently the API is supported on \l{Qt for Android}{Android},
-and \l{Qt for Linux/X11}{Linux} using \l {https://01.org/linux-nfc}{Neard} v0.14 or later.
+Currently, the API is supported on \l{Qt for Android}{Android}, \l{Qt for
+iOS}{iOS} and \l{Qt for Linux}{Linux} using
+\l {https://github.com/linux-nfc/neard}{Neard} v0.14 or later.
+This module also provides limited access to readers supporting
+\l{PC/SC in Qt NFC}{PC/SC} specification on Linux, macOS, and Windows.
-\section1 Overview
+NFC is a short-range (less than 20 centimeters) wireless technology
+with a maximum transfer rate of 424 Kbps. NFC is ideal for transferring
+small packets of data when two devices are placed together.
-NFC is an extremely short-range (less than 20 centimeters) wireless technology and has a
-maximum transfer rate of 424 kbit/s. NFC is ideal for transferring small packets of data when two
-devices are touched together.
+The NFC module provides APIs for interacting with NFC Forum Tags and NFC Forum
+Devices. It can detect targets and losses, register NDEF message handlers, read
+and write NDEF messages on NFC Forum Tags, and send tag-specific commands.
-The NFC API provides APIs for interacting with NFC Forum Tags and NFC Forum Devices, including
-target detection and loss, registering NDEF message handlers, reading and writing NDEF messages
-on NFC Forum Tags and sending tag specific commands.
+\section1 Using the Module
+\include {module-use.qdocinc} {using the c++ api} {NFC}
-\section1 Getting Started
+\section2 Building with CMake
-To use the C++ library in your application, add the following configuration
-option to your \c .pro file:
+\include {module-use.qdocinc} {building with cmake} {Nfc}
-\snippet snippets.pro project modification
+\section2 Building with qmake
-To use the classes of the module in your application you need the following
-import statement in your \c .qml file:
+\include {module-use.qdocinc} {building_with_qmake} {nfc}
-\snippet doc_src_qtnfc.qml import
+\section1 Articles and Guides
-\section1 Licenses
-
-Qt NFC is available under commercial licenses from \l{The Qt Company}.
-In addition, it is available under free software licenses. Since Qt 5.4,
-these free software licenses are
-\l{GNU Lesser General Public License, version 3}, or
-the \l{GNU General Public License, version 2}.
-See \l{Qt Licensing} for further details.
-
-\section1 Related Information
-
-\section2 Guides
\list
\li \l {Qt NFC Overview}
+ \li \l {Supported NFC Features}
+ \li \l {Qt NFC on Android}
+ \li \l {PC/SC in Qt NFC}
\endlist
-\section2 Reference
-\list
- \li \l {Qt NFC QML Types}{QML Types}
- \li \l {Qt NFC C++ Classes}{C++ Classes}
-\endlist
-
-\section2 Logging Categories
+\section1 Logging Categories
The \l QtNfc module exports the following
\l {Configuring Categories}{logging categories}:
@@ -96,17 +59,30 @@ The \l QtNfc module exports the following
\li Enables logging of the Neard/Linux implementation
\endtable
-\section2 Examples
+\section1 Examples
+
\list
- \li QML
- \list
- \li \l {corkboard}{CorkBoard}
- \li \l {poster}{QML Poster}
- \endlist
- \li C++
- \list
- \li \l {annotatedurl}{Annotated URL}
- \li \l {ndefeditor}{NDEF Editor}
- \endlist
+ \li \l {annotatedurl}{Annotated URL}
+ \li \l {ndefeditor}{NDEF Editor}
\endlist
+
+\section1 Reference
+
+\list
+ \li \l {Qt NFC C++ Classes}{C++ Classes}
+\endlist
+
+\section1 Module Evolution
+
+\l {Changes to Qt NFC} lists important changes in the module API and
+functionality that were done for the Qt 6 series of Qt.
+
+\section1 Licenses
+
+Qt NFC is available under commercial licenses from \l{The Qt Company}.
+In addition, it is available under free software licenses. Since Qt 5.4,
+these free software licenses are
+\l{GNU Lesser General Public License, version 3}, or
+the \l{GNU General Public License, version 2}.
+See \l{Qt Licensing} for further details.
*/
diff --git a/src/nfc/doc/src/nfc-overview.qdoc b/src/nfc/doc/src/nfc-overview.qdoc
index 6ac5c1dc..81e7212c 100644
--- a/src/nfc/doc/src/nfc-overview.qdoc
+++ b/src/nfc/doc/src/nfc-overview.qdoc
@@ -1,36 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\ingroup technology-apis
\title Qt NFC Overview
\page qtnfc-overview.html
\brief Provides access to NFC enabled devices.
+\ingroup explanations-networkingandconnectivity
\tableofcontents
@@ -45,8 +22,19 @@ With the Qt NFC API typical use cases are:
The following sections describe how to use Qt NFC C++ classes and QML types for the above use cases.
-\note On Android, Qt Nfc only works in foreground applications. Android services are not supported which is due to
-API limitations on the Android side.
+\note On Android, the detection of new NFC tags only works in foreground applications. Android
+services do not support this because of API limitations on the Android side. The only way to use a
+\l{https://developer.android.com/reference/android/nfc/Tag}{Tag} in a service is to provide an
+\l{https://developer.android.com/guide/components/aidl}{AIDL} interface accepting the Tag and forward
+it to Qt as shown in the following example.
+
+\code
+ public void setTag(Tag pTag) {
+ Intent newIntent = new Intent();
+ newIntent.putExtra(NfcAdapter.EXTRA_TAG, pTag);
+ QtNative.onNewIntent(newIntent);
+ }
+\endcode
\section1 C++ Overview
@@ -62,29 +50,78 @@ a tag comes into or leaves the range. The passed \l QNearFieldTarget parameter a
as primary interaction point for each detected tag. The detection does not actually start though until
\l QNearFieldManager::startTargetDetection() has been called.
-\snippet ndefeditor/mainwindow.cpp QNearFieldManager init
-\snippet ndefeditor/mainwindow.cpp QNearFieldManager start detection
+\code
+m_manager = new QNearFieldManager(this);
+connect(m_manager, &QNearFieldManager::targetDetected,
+ this, &MainWindow::targetDetected);
+connect(m_manager, &QNearFieldManager::targetLost,
+ this, &MainWindow::targetLost);
+m_manager->startTargetDetection(QNearFieldTarget::NdefAccess);
+\endcode
Finally the detection can be stopped:
-\snippet ndefeditor/mainwindow.cpp QNearFieldManager stop detection
+\code
+m_manager->stopTargetDetection();
+\endcode
Although each \l QNearFieldTarget instance is owned by its related \l QNearFieldManager
instance it can be beneficial to manually delete each instance. Otherwise they would continue to
exist until the \l QNearFieldManager instance is deleted. The best way to do that would be in response
to the \l QNearFieldManager::targetLost() signal:
-\snippet ndefeditor/mainwindow.cpp QNearFieldTarget lost
+\code
+void MainWindow::targetLost(QNearFieldTarget *target)
+{
+ target->deleteLater();
+}
+\endcode
\note The target object should only be deleted via deleteLater() if it is deleted inside the slot.
+\section2 Connecting NFC Tags
+
+All functions of \l QNearFieldTarget that require a connection will create one by its own.
+An active connection will prevent other instances to create a connection because only one
+connection at the time is allowed.
+
+Qt 5 disconnected the tag at the end of the functions to allow other instances to connect.
+QNearFieldManager::setKeepConnection() allowed to change this behavior.
+
+Since Qt 6, \l QNearFieldTarget keeps the connection by default. The connection is only closed
+when the \l QNearFieldTarget is destroyed or \l QNearFieldManager::disconnect() is called.
+
\section2 Reading and Writing NDEF Messages
The \l QNearFieldTarget instance returned by \l QNearFieldManager::targetDetected() signal
is used to interact with the tag. Reading and writing a message is an asynchronous operation.
The \l QNearFieldTarget::RequestId class associates individual operations and their results.
-\snippet ndefeditor/mainwindow.cpp QNearFieldTarget detected
+\code
+void MainWindow::targetDetected(QNearFieldTarget *target)
+{
+ switch (m_touchAction) {
+ case NoAction:
+ break;
+ case ReadNdef:
+ connect(target, &QNearFieldTarget::ndefMessageRead, this, &MainWindow::ndefMessageRead);
+ connect(target, &QNearFieldTarget::error, this, &MainWindow::targetError);
+
+ m_request = target->readNdefMessages();
+ if (!m_request.isValid()) // cannot read messages
+ targetError(QNearFieldTarget::NdefReadError, m_request);
+ break;
+ case WriteNdef:
+ connect(target, &QNearFieldTarget::requestCompleted, this, &MainWindow::ndefMessageWritten);
+ connect(target, &QNearFieldTarget::error, this, &MainWindow::targetError);
+
+ m_request = target->writeNdefMessages(QList<QNdefMessage>() << ndefMessage());
+ if (!m_request.isValid()) // cannot write messages
+ targetError(QNearFieldTarget::NdefWriteError, m_request);
+ break;
+ }
+}
+\endcode
Once the \l QNearFieldTarget::readNdefMessages() request was successfully processed, the
\l QNearFieldTarget::ndefMessageRead() signal is emitted. Each returned \l QNdefMessage
@@ -92,62 +129,7 @@ may consist of zero or more \l QNdefRecord entries, which can be identified by t
For more information about processing of records, see the \l QNdefRecord class documentation.
As the above code demonstrates, writing of NDEF messages is triggered via
\l QNearFieldTarget::writeNdefMessages(). The successful completion of the write operation
-is indicated by the emission of the \l QNearFieldTarget::ndefMessagesWritten() signal. Any
-type of error during read or write is indicated via \l QNearFieldTarget::error().
-
-\section2 Registering NDEF Message Handlers
-
-The above described method (of reading NDEF messages) directly connects to the platform's NFC infrastructure.
-However on some platforms (in particular mobile platforms) this may not actually trigger the target slot
-if the application is currently running in the background. This is not desirable in cases where an
-application wants to be activated if the platform detects a tag of particular type.
-For this purpose the Qt NFC API provides the possibility to register an NDEF message handler. The handler
-is called by the operating system, when the detected NDEF message matches the given filter criteria.
-Depending on the platform it may even be possible to start the application that registered the handler.
-
-\note This feature is not available on all platforms and, in addition to the code snippets below,
-may require further platform specific setup.
-
-\snippet annotatedurl/annotatedurl.cpp QNearFieldManager register handler
-
-For comparison an application that uses an empty NDEF filter (match all behavior) in combination with
-\l QNearFieldManager::registerNdefMessageHandler() would behave similarly to another application that uses
-\l QNearFieldTarget::readNdefMessages() while being in the forground. For more information about
-registration details of NDEF message handlers, see the
-\l {QNearFieldManager#automatically-launching-ndef-message-handlers}{QNearFieldManager} class description.
-
-The content of \c handleMessage() may look like the snippet below. Any incoming NDEF message of type
-\c text or \c uri will be processed:
-
-\snippet annotatedurl/annotatedurl.cpp handleMessage 1
-\snippet annotatedurl/annotatedurl.cpp handleMessage 2
-\snippet annotatedurl/annotatedurl.cpp handleMessage 3
-\snippet annotatedurl/annotatedurl.cpp handleMessage 4
-
-\section2 Sharing Files and Messages
-
-Since Qt 5.3, Qt NFC provides a generic NFC share feature. If both devices support the same protocol,
-the feature can be used to share files or NDEF messages. The advantage is that the two involved partners
-can quickly establish a connection via NFC but transfer the data through, for example, Bluetooth or Wifi.
-Effectively, this combines the low configuration effort of NFC with high data rate communication bearers
-which usually require a much more complex setup.
-
-\note The API does not make any guarantees about the actual communication bearer used during the transfer.
-The bearer is chosen based on the device's capabilities and the properties of the to-be-shared data.
-
-\l QNearFieldShareManager and \l QNearFieldShareTarget are responsible for accessing the NFC share feature.
-
-\section1 QML Overview
-
-The QML API only supports a very small subset of the Qt NFC feature set. This section outlines the available QML features.
-
-\section2 Reading NDEF Messages
-
-The user can specify NDEF filters and use those filters to register for the automatic reception of NDEF
-messages which match those filters. The \l NearField::messageRecords property contains the list of NDEF records
-of the last NDEF message read matching the given filters.
-
-\snippet doc_src_qtnfc.qml QML register for messages
-
-If no filter is set, the message handler will match all incoming NDEF messages.
+is indicated by the emission of the \l QNearFieldTarget::requestCompleted() signal with the
+corresponding request id. Any type of error during read or write is indicated via
+\l QNearFieldTarget::error().
*/
diff --git a/src/nfc/doc/src/nfc-pcsc.qdoc b/src/nfc/doc/src/nfc-pcsc.qdoc
new file mode 100644
index 00000000..532f0311
--- /dev/null
+++ b/src/nfc/doc/src/nfc-pcsc.qdoc
@@ -0,0 +1,34 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qtnfc-pcsc.html
+\title PC/SC in Qt NFC
+\ingroup connectivity-nfc
+\inmodule QtNfc
+\since 6.4
+\brief Notes on PC/SC support in Qt Nfc.
+
+PC/SC support is provided using native APIs on macOS and Windows, and using
+\l{https://pcsclite.apdu.fr/}{PCSCLite} library on other platforms. The API
+can be used for accessing both wired and wireless smartcards and storage cards.
+
+\section1 Limitations
+
+\list
+ \li The current API does not provide means to distinguish between separate
+ readers/slots.
+ \li NDEF access is only provided for NFC Type 4 tags.
+ \li Other applications starting transactions on cards may block Qt applications
+ from using Qt Nfc API.
+ \li QNearFieldTarget::sendCommand() used with a PC/SC target starts
+ a transaction that remains active until QNearFieldTarget::disconnect()
+ is called. This transaction prevents other applications from accessing
+ this target.
+ \li The backend is polling for new tags, that means that there
+ may be a delay up to the full polling interval before new tags are reported.
+ The default polling interval is 100 milliseconds. It can be adjusted
+ by setting environment valiable \c{QT_NFC_POLL_INTERVAL_MS} to an integer
+ value in milliseconds.
+\endlist
+*/
diff --git a/src/nfc/doc/src/nfc-qml.qdoc b/src/nfc/doc/src/nfc-qml.qdoc
deleted file mode 100644
index 48ae3bd2..00000000
--- a/src/nfc/doc/src/nfc-qml.qdoc
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-/*!
-
-\qmlmodule QtNfc \QtVer
-\title Qt NFC QML Types
-\ingroup qmlmodules
-\brief Provides QML types for accessing NFC Forum Tags.
-
-To use the classes of the module in your application, you need the following
-import statement in your \c .qml file:
-
-\qml \QtVer
-import QtNfc \1
-\endqml
-*/
-
diff --git a/src/nfc/doc/src/qt6-changes.qdoc b/src/nfc/doc/src/qt6-changes.qdoc
new file mode 100644
index 00000000..5b25571e
--- /dev/null
+++ b/src/nfc/doc/src/qt6-changes.qdoc
@@ -0,0 +1,149 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtnfc-changes-qt6.html
+ \title Changes to Qt NFC
+ \ingroup changes-qt-5-to-6
+ \brief Migrate Qt NFC to Qt 6.
+
+ Qt 6 is a result of the conscious effort to make the framework more
+ efficient and easy to use.
+
+ We try to maintain binary and source compatibility for all the public
+ APIs in each release. But some changes were inevitable in an effort to
+ make Qt a better framework.
+
+ In this topic we summarize those changes in Qt NFC, and provide guidance
+ to handle them.
+
+ \section1 New Features and Methods
+
+ \section2 Added \l QNdefRecord::clear()
+
+ Use this method to clear an NDEF record.
+
+ \section2 Added \l QNdefFilter::match()
+
+ Use this method to check if a \l QNdefMessage matches the given filter.
+ The method returns \c true in case of successful match and \c false
+ otherwise.
+
+ \section2 Extended \l QNearFieldTarget::Type
+
+ The enum was extended with two more types:
+ \list
+ \li \l QNearFieldTarget::NfcTagType4A
+ \li \l QNearFieldTarget::NfcTagType4B
+ \endlist
+
+ \section1 Changes in the Features and Methods
+
+ \section2 Renamed QNearFieldManager::isAvailable()
+
+ The \c QNearFieldManager::isAvailable() was renamed to
+ \l QNearFieldManager::isEnabled().
+
+ \section2 Added access method argument to \l QNearFieldManager::isSupported
+
+ The \c accessMethod argument allows to check if a specific feature is
+ supported. This is relevant because different platforms or versions of
+ operating systems can support different options.
+
+ \section2 Added access method argument to \l QNearFieldManager::startTargetDetection
+
+ The \c accessMethod argument allows to scan for NFC tags with the given
+ access method.
+
+ \section2 Changed \l QNdefNfcSmartPosterRecord::typeInfo from \l QByteArray to \l QString
+
+ According to NDEF Smart Poster specification, the type is a UTF-8 formatted
+ string.
+ This affects the \l QNdefNfcSmartPosterRecord::typeInfo() and
+ \l QNdefNfcSmartPosterRecord::setTypeInfo() methods.
+
+ \section2 Updated return type of \l QNdefFilter::appendRecord
+
+ \l QNdefFilter::appendRecord now performs a basic validation of input
+ parameters and returns a boolean value indicating if the record is appended
+ to the filter or not.
+
+ \section1 Removed Features and Methods
+
+ \section2 Removed QNearFieldTarget::url
+
+ The method was never implemented in the existing subclasses of
+ \l QNearFieldTarget.
+
+ \section2 Removed QNearFieldTarget::sendCommands
+
+ In Qt 5, the method was not very helpful because it didn't provide a way to
+ track the results of intermediate commands. Normally, an additional command
+ needs to be sent only when the previous command is successfully executed.
+
+ The correct approach would be to manually create a queue of commands,
+ use \l QNearFieldTarget::sendCommand to send a command and
+ \l QNearFieldTarget::requestCompleted or \l QNearFieldTarget::error to
+ handle the results of each command individually.
+
+ \section2 Removed QNearFieldTarget::keepConnection
+
+ The methods \c QNearFieldTarget::keepConnection() and
+ \c QNearFieldTarget::setKeepConnection() were removed. Keeping the
+ connection is the default behavior for now.
+
+ \section2 Removed QNearFieldTarget::isProcessingCommand
+
+ The method was never implemented and always returned \c false.
+
+ \section2 Made QNearFieldTarget::setResponseForRequest private API
+
+ The method should not be exposed as a public API. Use
+ \l QNearFieldTarget::ndefMessageRead or \l QNearFieldTarget::requestResponse
+ to read the data from an NFC tag.
+
+ \section2 Removed QNearFieldTarget::handleResponse
+
+ The method was removed as it just forwarded the call to
+ \c QNearFieldManager::setResponseForRequest, which became private API.
+
+ \section2 Made QNearFieldTarget::reportError private API
+
+ A \l QNearFieldTarget::error signal can be used instead.
+
+ \section2 Removed QNearFieldTarget::ndefMessagesWritten signal
+
+ The \l QNearFieldTarget::requestCompleted signal is used for both NDEF
+ messages and custom commands. The \c id parameter can be used to check which
+ request is actually completed.
+
+ \section2 Removed QNearFieldManager::(un)registerNdefMessageHandler
+
+ The methods \c QNearFieldTarget::registerNdefMessageHandler and
+ \c QNearFieldTarget::unregisterNdefMessageHandler were removed.
+
+ Use \l QNearFieldTarget::ndefMessageRead() and \l QNdefFilter::match() to
+ detect the NDEF messages and filter the required ones.
+
+ \note The application can still be automatically started once the NDEF Tag
+ is touched. The \l {annotatedurl}{Annotated URL} example shows how to
+ achieve it on Android.
+
+ \section2 Removed QNearFieldManager::TargetAccessModes
+
+ The \c TargetAccessModes enum was removed together with the getter and
+ setter methods (\c QNearFieldManager::setTargetAccessModes() and
+ \c {QNearFieldManager::targetAccessModes()}).
+
+ The feature is not supported on Android and iOS platforms.
+
+ \section2 Removed QNearFieldShareManager and QNearFieldShareTarget
+
+ File sharing via NFC is deprecated on Android in API 29. Other technologies
+ should be used instead.
+
+ \section2 Removed QML API
+
+ The support for QML API is discontinued.
+
+*/