Qt NFC

NFC API 在啓用 NFC 的設備之間提供連接。

Currently, the API is supported on Android and iOS . This module also provides limited access to readers supporting PC/SC specification on Linux, macOS, and Windows.

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.

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.

使用模塊

Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .

構建采用 CMake

使用 find_package() command to locate the needed module component in the Qt6 包:

find_package(Qt6 REQUIRED COMPONENTS Nfc)
target_link_libraries(mytarget PRIVATE Qt6::Nfc)
					

更多細節,見 構建采用 CMake 概述。

采用 qmake 構建

To configure the module for building with qmake, add the module as a value of the QT variable in the project's .pro file:

QT += nfc
					

文章和指南

範例

參考

Module Evolution

Changes to Qt NFC lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.

許可

Qt NFC 在商業許可下是可用的來自 Qt 公司 。此外,它在自由軟件許可下也是可用的。從 Qt 5.4 起,這些自由軟件許可是 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。