summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-05-27 09:21:08 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-06-23 08:22:31 +0000
commitacaab9e6425726d7a3901e6224c6e59874bc5a62 (patch)
tree443521d372c2be777626000d26d52e834a661838 /src/imports
parent3acd1a5d4fc4dc501d8b0a149909511e91aafb05 (diff)
Port from Q_ENUMS to new macro Q_ENUM
Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. Register some enums via Q_ENUM to improve debug output and types auto-registration. Change-Id: I31c9535a2de7da1783b4ec967612c02a57cb62ff Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h4
-rw-r--r--src/imports/bluetooth/qdeclarativebluetoothservice_p.h3
-rw-r--r--src/imports/bluetooth/qdeclarativebluetoothsocket_p.h5
-rw-r--r--src/imports/nfc/qdeclarativendeftextrecord_p.h3
4 files changed, 6 insertions, 9 deletions
diff --git a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h
index 82a2129b..a06d49c4 100644
--- a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h
+++ b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h
@@ -64,8 +64,6 @@ class QDeclarativeBluetoothDiscoveryModelPrivate;
class QDeclarativeBluetoothDiscoveryModel : public QAbstractListModel, public QQmlParserStatus
{
Q_OBJECT
- Q_ENUMS(DiscoveryMode)
- Q_ENUMS(Error)
Q_PROPERTY(Error error READ error NOTIFY errorChanged)
Q_PROPERTY(DiscoveryMode discoveryMode READ discoveryMode WRITE setDiscoveryMode NOTIFY discoveryModeChanged)
Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged)
@@ -88,6 +86,7 @@ public:
FullServiceDiscovery,
DeviceDiscovery
};
+ Q_ENUM(DiscoveryMode)
enum Error
{
@@ -97,6 +96,7 @@ public:
UnknownError,
InvalidBluetoothAdapterError
};
+ Q_ENUM(Error)
Error error() const;
diff --git a/src/imports/bluetooth/qdeclarativebluetoothservice_p.h b/src/imports/bluetooth/qdeclarativebluetoothservice_p.h
index 9cb62de9..17611580 100644
--- a/src/imports/bluetooth/qdeclarativebluetoothservice_p.h
+++ b/src/imports/bluetooth/qdeclarativebluetoothservice_p.h
@@ -66,9 +66,7 @@ class QDeclarativeBluetoothService : public QObject, public QQmlParserStatus
Q_PROPERTY(QString serviceUuid READ serviceUuid WRITE setServiceUuid NOTIFY detailsChanged)
Q_PROPERTY(Protocol serviceProtocol READ serviceProtocol WRITE setServiceProtocol NOTIFY detailsChanged)
Q_PROPERTY(bool registered READ isRegistered WRITE setRegistered NOTIFY registeredChanged)
-
Q_INTERFACES(QQmlParserStatus)
- Q_ENUMS(Protocol)
public:
/// TODO: Merge/Replace with QBluetoothServiceInfo::Protocol in Qt 6
@@ -77,6 +75,7 @@ public:
L2CapProtocol = QBluetoothServiceInfo::L2capProtocol,
UnknownProtocol = QBluetoothServiceInfo::UnknownProtocol
};
+ Q_ENUM(Protocol)
explicit QDeclarativeBluetoothService(QObject *parent = 0);
explicit QDeclarativeBluetoothService(const QBluetoothServiceInfo &service,
diff --git a/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h b/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h
index 4ad69f9e..a626c7cf 100644
--- a/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h
+++ b/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h
@@ -67,11 +67,8 @@ class QDeclarativeBluetoothSocket : public QObject, public QQmlParserStatus
Q_PROPERTY(SocketState socketState READ state NOTIFY stateChanged)
Q_PROPERTY(QString stringData READ stringData WRITE sendStringData NOTIFY dataAvailable)
Q_INTERFACES(QQmlParserStatus)
- Q_ENUMS(Error)
- Q_ENUMS(SocketState)
public:
-
enum Error {
NoError = QBluetoothSocket::NoSocketError,
UnknownSocketError = QBluetoothSocket::UnknownSocketError,
@@ -80,6 +77,7 @@ public:
NetworkError = QBluetoothSocket::NetworkError,
UnsupportedProtocolError = QBluetoothSocket::UnsupportedProtocolError
};
+ Q_ENUM(Error)
enum SocketState {
Unconnected = QBluetoothSocket::UnconnectedState,
@@ -91,6 +89,7 @@ public:
Listening = QBluetoothSocket::ListeningState,
NoServiceSet = 100 //Leave gap for future enums and to avoid collision with QBluetoothSocket enums
};
+ Q_ENUM(SocketState)
explicit QDeclarativeBluetoothSocket(QObject *parent = 0);
explicit QDeclarativeBluetoothSocket(QDeclarativeBluetoothService *service,
diff --git a/src/imports/nfc/qdeclarativendeftextrecord_p.h b/src/imports/nfc/qdeclarativendeftextrecord_p.h
index 8a65a951..4699f5a2 100644
--- a/src/imports/nfc/qdeclarativendeftextrecord_p.h
+++ b/src/imports/nfc/qdeclarativendeftextrecord_p.h
@@ -59,8 +59,6 @@ class QDeclarativeNdefTextRecord : public QQmlNdefRecord
Q_PROPERTY(QString locale READ locale WRITE setLocale NOTIFY localeChanged)
Q_PROPERTY(LocaleMatch localeMatch READ localeMatch NOTIFY localeMatchChanged)
- Q_ENUMS(LocaleMatch)
-
public:
enum LocaleMatch {
LocaleMatchedNone,
@@ -68,6 +66,7 @@ public:
LocaleMatchedLanguage,
LocaleMatchedLanguageAndCountry
};
+ Q_ENUM(LocaleMatch)
explicit QDeclarativeNdefTextRecord(QObject *parent = 0);
Q_INVOKABLE QDeclarativeNdefTextRecord(const QNdefRecord &record, QObject *parent = 0);