diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-03-10 15:48:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-11 15:51:07 +0100 |
commit | eb52c891559a2c763dc682c82be9b03bd09316b3 (patch) | |
tree | c227c288b685357f386b66f2a7cbc94b2e84de41 /src/nfc | |
parent | ef98583d2a5350602d0dac2736c772bfd84ebadb (diff) |
Fix code snippet error in docs and point out supported NFC platforms
The code snippet was shifted into a compiled project to ensure continued
compilation.
Task-number: QTBUG-34978
Change-Id: I93f3b39442992bfb4049a44ed0dd6330d3ca9270
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Diffstat (limited to 'src/nfc')
-rw-r--r-- | src/nfc/doc/snippets/doc_src_qtnfc.cpp | 24 | ||||
-rw-r--r-- | src/nfc/doc/src/nfc-index.qdoc | 2 | ||||
-rw-r--r-- | src/nfc/qnearfieldmanager.cpp | 6 |
3 files changed, 27 insertions, 5 deletions
diff --git a/src/nfc/doc/snippets/doc_src_qtnfc.cpp b/src/nfc/doc/snippets/doc_src_qtnfc.cpp index b7b0dfc4..62aa65e2 100644 --- a/src/nfc/doc/snippets/doc_src_qtnfc.cpp +++ b/src/nfc/doc/snippets/doc_src_qtnfc.cpp @@ -38,11 +38,35 @@ ** ****************************************************************************/ +#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/src/nfc-index.qdoc b/src/nfc/doc/src/nfc-index.qdoc index e82973d4..2944a6ab 100644 --- a/src/nfc/doc/src/nfc-index.qdoc +++ b/src/nfc/doc/src/nfc-index.qdoc @@ -38,6 +38,8 @@ The NFC API provides APIs for interacting with NFC Forum Tags and NFC Forum Devi target detection and loss, registering NDEF message handlers, reading and writing NDEF messages on NFC Forum Tags and sending tag specific commands. +Currently the API is supported on BlackBerry 10. + \section1 Getting started To use the C++ library in your application, add the following configuration diff --git a/src/nfc/qnearfieldmanager.cpp b/src/nfc/qnearfieldmanager.cpp index f2fafdce..88656a6e 100644 --- a/src/nfc/qnearfieldmanager.cpp +++ b/src/nfc/qnearfieldmanager.cpp @@ -103,11 +103,7 @@ QT_BEGIN_NAMESPACE If the application has been registered as an NDEF message handler, the application only needs to call the registerNdefMessageHandler() function: - \code - QNearFieldManager *manager = new QNearFieldManager; - manager->registerNdefMessageHandler(this, - SLOT(handleNdefMessage(QNdefMessage,QNearFieldTarget))); - \endcode + \snippet doc_src_qtnfc.cpp handleNdefMessage On BlackBerry the registration for NDEF message handlers is done over the \l{https://developer.blackberry.com/native/documentation/core/invocation_framework.html}{Invocation Framework}. |