diff options
-rw-r--r-- | examples/nfc/annotatedurl/mainwindow.h | 2 | ||||
-rw-r--r-- | examples/nfc/ndefeditor/mainwindow.h | 2 | ||||
-rw-r--r-- | examples/nfc/ndefeditor/mimeimagerecordeditor.h | 3 | ||||
-rw-r--r-- | examples/nfc/ndefeditor/textrecordeditor.h | 2 | ||||
-rw-r--r-- | examples/nfc/ndefeditor/urirecordeditor.h | 2 | ||||
-rw-r--r-- | src/nfc/nfc.pro | 5 | ||||
-rw-r--r-- | src/nfc/qndefrecord.cpp | 7 | ||||
-rw-r--r-- | src/nfc/qndefrecord.h | 2 | ||||
-rw-r--r-- | src/src.pro | 9 | ||||
-rw-r--r-- | tests/auto/auto.pro | 2 | ||||
-rw-r--r-- | tests/auto/qnearfieldmanager/qnearfieldmanager.pro | 7 | ||||
-rw-r--r-- | tests/auto/qnearfieldtagtype1/qnearfieldtagtype1.pro | 7 | ||||
-rw-r--r-- | tests/auto/qnearfieldtagtype2/qnearfieldtagtype2.pro | 7 |
13 files changed, 28 insertions, 29 deletions
diff --git a/examples/nfc/annotatedurl/mainwindow.h b/examples/nfc/annotatedurl/mainwindow.h index b90e4a47..b038be4a 100644 --- a/examples/nfc/annotatedurl/mainwindow.h +++ b/examples/nfc/annotatedurl/mainwindow.h @@ -45,9 +45,11 @@ QT_FORWARD_DECLARE_CLASS(QUrl) +QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } +QT_END_NAMESPACE class MainWindow : public QMainWindow { diff --git a/examples/nfc/ndefeditor/mainwindow.h b/examples/nfc/ndefeditor/mainwindow.h index c6fc9bf7..ea44e074 100644 --- a/examples/nfc/ndefeditor/mainwindow.h +++ b/examples/nfc/ndefeditor/mainwindow.h @@ -54,9 +54,11 @@ QT_END_NAMESPACE_NFC QT_USE_NAMESPACE_NFC +QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } +QT_END_NAMESPACE class MainWindow : public QMainWindow { diff --git a/examples/nfc/ndefeditor/mimeimagerecordeditor.h b/examples/nfc/ndefeditor/mimeimagerecordeditor.h index 0bad7694..fabfe5f6 100644 --- a/examples/nfc/ndefeditor/mimeimagerecordeditor.h +++ b/examples/nfc/ndefeditor/mimeimagerecordeditor.h @@ -50,9 +50,12 @@ QT_USE_NAMESPACE_NFC +QT_BEGIN_NAMESPACE namespace Ui { class MimeImageRecordEditor; } +QT_END_NAMESPACE + class MimeImageRecordEditor : public QWidget { diff --git a/examples/nfc/ndefeditor/textrecordeditor.h b/examples/nfc/ndefeditor/textrecordeditor.h index 798eef49..c5b51cc4 100644 --- a/examples/nfc/ndefeditor/textrecordeditor.h +++ b/examples/nfc/ndefeditor/textrecordeditor.h @@ -45,9 +45,11 @@ #include <qndefnfctextrecord.h> +QT_BEGIN_NAMESPACE namespace Ui { class TextRecordEditor; } +QT_END_NAMESPACE QT_USE_NAMESPACE_NFC diff --git a/examples/nfc/ndefeditor/urirecordeditor.h b/examples/nfc/ndefeditor/urirecordeditor.h index edfdd333..02fc910e 100644 --- a/examples/nfc/ndefeditor/urirecordeditor.h +++ b/examples/nfc/ndefeditor/urirecordeditor.h @@ -46,9 +46,11 @@ #include <qndefnfcurirecord.h> +QT_BEGIN_NAMESPACE namespace Ui { class UriRecordEditor; } +QT_END_NAMESPACE QT_USE_NAMESPACE_NFC diff --git a/src/nfc/nfc.pro b/src/nfc/nfc.pro index e58308de..f92120ce 100644 --- a/src/nfc/nfc.pro +++ b/src/nfc/nfc.pro @@ -6,11 +6,6 @@ load(qt_module) QMAKE_DOCS = $$PWD/doc/qtnfc.qdocconf OTHER_FILES += doc/src/*.qdoc # show .qdoc files in Qt Creator -# All classes in this module are in the QtNfc namespace. Define the namespace which moc generated -# code will be in. -DEFINES += QT_BEGIN_MOC_NAMESPACE=\""namespace QtNfc {"\" -DEFINES += QT_END_MOC_NAMESPACE=\""}"\" - PUBLIC_HEADERS += \ qnfcglobal.h \ qnearfieldmanager.h \ diff --git a/src/nfc/qndefrecord.cpp b/src/nfc/qndefrecord.cpp index fea5dae4..ed950ea0 100644 --- a/src/nfc/qndefrecord.cpp +++ b/src/nfc/qndefrecord.cpp @@ -43,6 +43,8 @@ #include "qndefrecord.h" #include "qndefrecord_p.h" +#include <QtCore/QHash> + QT_BEGIN_NAMESPACE_NFC /*! @@ -147,6 +149,11 @@ QT_BEGIN_NAMESPACE_NFC \sa Q_DECLARE_NDEF_RECORD() */ +uint qHash(const QNdefRecord &key) +{ + return qHash(key.type() + key.id() + key.payload()); +} + /*! Constructs a new empty NDEF record. */ diff --git a/src/nfc/qndefrecord.h b/src/nfc/qndefrecord.h index b3fad95e..a896f5f1 100644 --- a/src/nfc/qndefrecord.h +++ b/src/nfc/qndefrecord.h @@ -112,6 +112,8 @@ private: } \ QT_END_NAMESPACE_NFC +uint qHash(const QNdefRecord &key); + QT_END_NAMESPACE_NFC #endif // QNDEFRECORD_H diff --git a/src/src.pro b/src/src.pro index 1f96b1f1..9f865e0a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,11 +1,4 @@ TEMPLATE = subdirs CONFIG += ordered -# The Qt NFC module is currently not supported. The API is not finalized and may change. -# The Qt NFC module can be built by passing CONFIG+=nfc to qmake. -nfc { - message("Building unsupported Qt NFC module, API is not finalized and may change.") - SUBDIRS += nfc -} - -SUBDIRS += bluetooth imports +SUBDIRS += bluetooth nfc imports diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index a88d77a2..9d817c7e 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -26,7 +26,7 @@ qtHaveModule(nfc) { qndefrecord \ qnearfieldmanager \ qnearfieldtagtype1 \ - qnearfieldtagtype2 \ + qnearfieldtagtype2 } qbluetoothservicediscoveryagent.CONFIG += no_check_target # QTBUG-22017 diff --git a/tests/auto/qnearfieldmanager/qnearfieldmanager.pro b/tests/auto/qnearfieldmanager/qnearfieldmanager.pro index 532409ab..558f00fd 100644 --- a/tests/auto/qnearfieldmanager/qnearfieldmanager.pro +++ b/tests/auto/qnearfieldmanager/qnearfieldmanager.pro @@ -1,3 +1,5 @@ +requires(contains(QT_CONFIG, private_tests)) + SOURCES += tst_qnearfieldmanager.cpp TARGET = tst_qnearfieldmanager CONFIG += testcase @@ -7,11 +9,6 @@ QT = core nfc-private testlib INCLUDEPATH += ../../../src/nfc VPATH += ../../../src/nfc -# This test includes source code from QtNfc library. Define the namespace which moc generated code -# should be in. -DEFINES += QT_BEGIN_MOC_NAMESPACE=\""namespace QtNfc {"\" -DEFINES += QT_END_MOC_NAMESPACE=\""}"\" - HEADERS += \ qnearfieldmanagervirtualbase_p.h \ qnearfieldmanager_emulator_p.h \ diff --git a/tests/auto/qnearfieldtagtype1/qnearfieldtagtype1.pro b/tests/auto/qnearfieldtagtype1/qnearfieldtagtype1.pro index 9f4ea6d5..818392a7 100644 --- a/tests/auto/qnearfieldtagtype1/qnearfieldtagtype1.pro +++ b/tests/auto/qnearfieldtagtype1/qnearfieldtagtype1.pro @@ -1,3 +1,5 @@ +requires(contains(QT_CONFIG, private_tests)) + SOURCES += tst_qnearfieldtagtype1.cpp TARGET = tst_qnearfieldtagtype1 CONFIG += testcase @@ -7,11 +9,6 @@ QT = core nfc-private testlib INCLUDEPATH += ../../../src/nfc VPATH += ../../../src/nfc -# This test includes source code from QtNfc library. Define the namespace which moc generated code -# should be in. -DEFINES += QT_BEGIN_MOC_NAMESPACE=\""namespace QtNfc {"\" -DEFINES += QT_END_MOC_NAMESPACE=\""}"\" - HEADERS += \ qnearfieldmanagervirtualbase_p.h \ qnearfieldmanager_emulator_p.h \ diff --git a/tests/auto/qnearfieldtagtype2/qnearfieldtagtype2.pro b/tests/auto/qnearfieldtagtype2/qnearfieldtagtype2.pro index 36e80260..931df5d6 100644 --- a/tests/auto/qnearfieldtagtype2/qnearfieldtagtype2.pro +++ b/tests/auto/qnearfieldtagtype2/qnearfieldtagtype2.pro @@ -1,3 +1,5 @@ +requires(contains(QT_CONFIG, private_tests)) + SOURCES += tst_qnearfieldtagtype2.cpp TARGET = tst_qnearfieldtagtype2 CONFIG += testcase @@ -7,11 +9,6 @@ QT = core nfc-private testlib INCLUDEPATH += ../../../src/nfc VPATH += ../../../src/nfc -# This test includes source code from QtNfc library. Define the namespace which moc generated code -# should be in. -DEFINES += QT_BEGIN_MOC_NAMESPACE=\""namespace QtNfc {"\" -DEFINES += QT_END_MOC_NAMESPACE=\""}"\" - HEADERS += \ qnearfieldmanagervirtualbase_p.h \ qnearfieldtarget_emulator_p.h \ |