summaryrefslogtreecommitdiffstats
path: root/examples/nfc/annotatedurl/annotatedurl.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2014-12-08 11:19:16 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2014-12-10 12:47:40 +0100
commit026714701477706231298e92878286930baf3948 (patch)
tree6a2cd84e6d91dbf9efdd8f26884357ac0a931d94 /examples/nfc/annotatedurl/annotatedurl.h
parent994934b36bcfa74da8975ec31da528ddded50e16 (diff)
Enable automatic tag polling if message handler is not supported.
All examples have used message handler registration so far. That's not always supported on all platforms. Neard is one of those platforms against which this this was verified. This patch converts some examples to use manual target detection if handler registration fails. Change-Id: Icfd8b7c695e63351a45b867fd69e9fc5fefb9360 Reviewed-by: Martin Leutelt <martin.leutelt@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/nfc/annotatedurl/annotatedurl.h')
-rw-r--r--examples/nfc/annotatedurl/annotatedurl.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/nfc/annotatedurl/annotatedurl.h b/examples/nfc/annotatedurl/annotatedurl.h
index 863f0976..b0c69a62 100644
--- a/examples/nfc/annotatedurl/annotatedurl.h
+++ b/examples/nfc/annotatedurl/annotatedurl.h
@@ -42,16 +42,14 @@
#define ANNOTATEDURL_H
#include <qnfcglobal.h>
+#include <QNdefMessage>
#include <QtCore/QObject>
QT_FORWARD_DECLARE_CLASS(QUrl)
QT_FORWARD_DECLARE_CLASS(QPixmap)
-
-QT_BEGIN_NAMESPACE
-class QNearFieldTarget;
-class QNdefMessage;
-QT_END_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QNearFieldManager)
+QT_FORWARD_DECLARE_CLASS(QNearFieldTarget)
QT_USE_NAMESPACE
@@ -67,7 +65,12 @@ signals:
void annotatedUrl(const QUrl &url, const QString &title, const QPixmap &pixmap);
public slots:
+ void targetDetected(QNearFieldTarget *target);
+ void targetLost(QNearFieldTarget *target);
void handleMessage(const QNdefMessage &message, QNearFieldTarget *target);
+ void handlePolledNdefMessage(QNdefMessage message);
+private:
+ QNearFieldManager *manager;
};
#endif // ANNOTATEDURL_H