Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qndefmessage.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNDEFMESSAGE_H
5#define QNDEFMESSAGE_H
6
7#include <QtCore/QSet>
8#include <QtCore/QList>
9#include <QtCore/QMetaType>
10#include <QtNfc/qtnfcglobal.h>
11#include <QtNfc/QNdefRecord>
12
14
15// This class used to be exported exposing QList methods, see QTBUG-102367.
16#if defined(QT_BUILD_NFC_LIB)
17# define Q_NFC_EXPORT_COMPAT QT6_ONLY(Q_NFC_EXPORT)
18#else
19# define Q_NFC_EXPORT_COMPAT
20#endif
21
22class QNdefMessage : public QList<QNdefRecord>
23{
24public:
26 QNdefMessage() = default;
32 QNdefMessage(const QList<QNdefRecord> &records) : QList<QNdefRecord>(records) { }
33
37 QNdefMessage &operator=(QNdefMessage &&other) noexcept = default;
38
39 Q_NFC_EXPORT bool operator==(const QNdefMessage &other) const;
40
41 Q_NFC_EXPORT QByteArray toByteArray() const;
42
43 Q_NFC_EXPORT static QNdefMessage fromByteArray(const QByteArray &message);
44};
45
47
49
50#endif // QNDEFMESSAGE_H
\inmodule QtCore
Definition qbytearray.h:57
Definition qlist.h:75
void append(parameter_type t)
Definition qlist.h:458
The QNdefMessage class provides an NFC NDEF message.
Q_NFC_EXPORT_COMPAT QNdefMessage()=default
Constructs a new empty NDEF message.
Q_NFC_EXPORT_COMPAT QNdefMessage(const QNdefMessage &message)=default
Constructs a new NDEF message that is a copy of message.
Q_NFC_EXPORT QByteArray toByteArray() const
Returns the NDEF message as a byte array.
static Q_NFC_EXPORT QNdefMessage fromByteArray(const QByteArray &message)
Returns an NDEF message parsed from the contents of message.
Q_NFC_EXPORT_COMPAT QNdefMessage & operator=(QNdefMessage &&other) noexcept=default
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_NFC_EXPORT_COMPAT QNdefMessage & operator=(const QNdefMessage &other)=default
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_NFC_EXPORT_COMPAT QNdefMessage(const QNdefRecord &record)
Constructs a new NDEF message containing a single record record.
Q_NFC_EXPORT_COMPAT QNdefMessage(const QList< QNdefRecord > &records)
Constructs a new NDEF message that contains all of the records in records.
Q_NFC_EXPORT bool operator==(const QNdefMessage &other) const
Returns true if this NDEF message is equivalent to other; otherwise returns false.
The QNdefRecord class provides an NFC NDEF record.
Definition qndefrecord.h:16
Combined button and popup list for selecting options.
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
#define Q_NFC_EXPORT_COMPAT
GLuint GLsizei const GLchar * message
MyRecord record(int row) const
[0]
QSharedPointer< T > other(t)
[5]