summaryrefslogtreecommitdiffstats
path: root/src/nfc
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-06-27 11:12:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-10 10:23:55 +0200
commit3b51f6e32f9c95e63e9ed4e55b79af5786a5677c (patch)
tree1bf5f49874765ab3136d3eec9aedaa0cdb22d370 /src/nfc
parent4fca8de918b4ae7b8b745f60847e28f948089445 (diff)
Add unit test and signal for/to QDeclarativeNdefRecord
Change-Id: Ifbfb2e11b072610b3f2c140a469ed73e110c2eca Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'src/nfc')
-rw-r--r--src/nfc/qdeclarativendefrecord.cpp19
-rw-r--r--src/nfc/qdeclarativendefrecord.h2
2 files changed, 20 insertions, 1 deletions
diff --git a/src/nfc/qdeclarativendefrecord.cpp b/src/nfc/qdeclarativendefrecord.cpp
index 8e405464..c9a4c2d7 100644
--- a/src/nfc/qdeclarativendefrecord.cpp
+++ b/src/nfc/qdeclarativendefrecord.cpp
@@ -113,12 +113,24 @@ QT_BEGIN_NAMESPACE_NFC
*/
/*!
+ \qmlproperty string NdefRecord::record
+
+ This property holds the NDEF record.
+*/
+
+/*!
\fn void QDeclarativeNdefRecord::recordTypeChanged()
This signal is emitted when the record type changes.
*/
/*!
+ \property QDeclarativeNdefRecord::record
+
+ This property hold the NDEF record that this class represents.
+*/
+
+/*!
\property QDeclarativeNdefRecord::recordType
This property hold the record type of the NDEF record that this class represents.
@@ -262,13 +274,18 @@ QNdefRecord QDeclarativeNdefRecord::record() const
}
/*!
- Sets the record to \a record.
+ Sets the record to \a record. If the record is set the recordChanged() signal will
+ be emitted.
*/
void QDeclarativeNdefRecord::setRecord(const QNdefRecord &record)
{
Q_D(QDeclarativeNdefRecord);
+ if (d->record == record)
+ return;
+
d->record = record;
+ emit recordChanged();
}
QT_END_NAMESPACE_NFC
diff --git a/src/nfc/qdeclarativendefrecord.h b/src/nfc/qdeclarativendefrecord.h
index 8ad40713..ae297ebe 100644
--- a/src/nfc/qdeclarativendefrecord.h
+++ b/src/nfc/qdeclarativendefrecord.h
@@ -57,6 +57,7 @@ class Q_NFC_EXPORT QDeclarativeNdefRecord : public QObject
Q_DECLARE_PRIVATE(QDeclarativeNdefRecord)
Q_PROPERTY(QString recordType READ recordType WRITE setRecordType NOTIFY recordTypeChanged)
+ Q_PROPERTY(QNdefRecord record READ record WRITE setRecord NOTIFY recordChanged)
public:
explicit QDeclarativeNdefRecord(QObject *parent = 0);
@@ -70,6 +71,7 @@ public:
Q_SIGNALS:
void recordTypeChanged();
+ void recordChanged();
private:
QDeclarativeNdefRecordPrivate *d_ptr;