summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-04-06 17:29:41 +0200
committerIvan Solovev <ivan.solovev@qt.io>2022-04-27 13:18:21 +0200
commit6fd8436dd6785529fbab21e27a56e951c45901d1 (patch)
treeeeb82d5d284bfb959662d2221b9fe2cd17a29a1b
parent358d1431bf0c53165a319efb2cb1b747c9b1e1f0 (diff)
Replace Q_DECLARE_METATYPE with QT_DECL_METATYPE_EXTERN
This reduces compilation time by avoiding repeated metatype instantiations. Can't pick to 6.3 or 6.2, because this introduces new exported symbols. As a drive-by: added missing QT_BEGIN/END_NAMESPACE macros Fixes: QTBUG-102215 Change-Id: If76d768b9565a43071dc73a8e738269048db86cb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/bluetooth/bluez/bluez5_helper.cpp6
-rw-r--r--src/bluetooth/bluez/bluez5_helper_p.h8
-rw-r--r--src/bluetooth/bluez/servicemap.cpp6
-rw-r--r--src/bluetooth/bluez/servicemap_p.h8
-rw-r--r--src/bluetooth/qbluetoothaddress.cpp2
-rw-r--r--src/bluetooth/qbluetoothaddress.h2
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.h4
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp3
-rw-r--r--src/bluetooth/qbluetoothdeviceinfo.cpp5
-rw-r--r--src/bluetooth/qbluetoothdeviceinfo.h5
-rw-r--r--src/bluetooth/qbluetoothhostinfo.cpp2
-rw-r--r--src/bluetooth/qbluetoothhostinfo.h2
-rw-r--r--src/bluetooth/qbluetoothlocaldevice.cpp4
-rw-r--r--src/bluetooth/qbluetoothlocaldevice.h9
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp5
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.h9
-rw-r--r--src/bluetooth/qbluetoothsocket_android.cpp1
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp2
-rw-r--r--src/bluetooth/qbluetoothuuid.h2
-rw-r--r--src/bluetooth/qlowenergycharacteristic.cpp2
-rw-r--r--src/bluetooth/qlowenergycharacteristic.h2
-rw-r--r--src/bluetooth/qlowenergyconnectionparameters.cpp2
-rw-r--r--src/bluetooth/qlowenergyconnectionparameters.h2
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp7
-rw-r--r--src/bluetooth/qlowenergycontroller.h14
-rw-r--r--src/bluetooth/qlowenergycontroller_android.cpp1
-rw-r--r--src/bluetooth/qlowenergydescriptor.cpp2
-rw-r--r--src/bluetooth/qlowenergydescriptor.h2
-rw-r--r--src/bluetooth/qlowenergyservice.cpp5
-rw-r--r--src/bluetooth/qlowenergyservice.h12
-rw-r--r--src/bluetooth/qlowenergyserviceprivate.cpp3
-rw-r--r--src/bluetooth/qlowenergyserviceprivate_p.h4
-rw-r--r--src/nfc/qndefmessage.cpp2
-rw-r--r--src/nfc/qndefmessage.h2
-rw-r--r--src/nfc/qnearfieldtarget.cpp2
-rw-r--r--src/nfc/qnearfieldtarget.h3
36 files changed, 120 insertions, 32 deletions
diff --git a/src/bluetooth/bluez/bluez5_helper.cpp b/src/bluetooth/bluez/bluez5_helper.cpp
index d4af7d51..e273a19e 100644
--- a/src/bluetooth/bluez/bluez5_helper.cpp
+++ b/src/bluetooth/bluez/bluez5_helper.cpp
@@ -50,6 +50,12 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(InterfaceList)
+QT_IMPL_METATYPE_EXTERN(ManufacturerDataList)
+QT_IMPL_METATYPE_EXTERN(ServiceDataList)
+QT_IMPL_METATYPE_EXTERN(ManagedObjectList)
+
+
Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ)
typedef enum Bluez5TestResultType
diff --git a/src/bluetooth/bluez/bluez5_helper_p.h b/src/bluetooth/bluez/bluez5_helper_p.h
index 7f3d1c04..665e59e0 100644
--- a/src/bluetooth/bluez/bluez5_helper_p.h
+++ b/src/bluetooth/bluez/bluez5_helper_p.h
@@ -62,10 +62,10 @@ typedef QMap<QDBusObjectPath, InterfaceList> ManagedObjectList;
typedef QMap<quint16, QDBusVariant> ManufacturerDataList;
typedef QMap<QString, QDBusVariant> ServiceDataList;
-Q_DECLARE_METATYPE(InterfaceList)
-Q_DECLARE_METATYPE(ManufacturerDataList)
-Q_DECLARE_METATYPE(ServiceDataList)
-Q_DECLARE_METATYPE(ManagedObjectList)
+QT_DECL_METATYPE_EXTERN(InterfaceList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(ManufacturerDataList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(ServiceDataList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(ManagedObjectList, /* not exported */)
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/bluez/servicemap.cpp b/src/bluetooth/bluez/servicemap.cpp
index 46616cbe..97471ded 100644
--- a/src/bluetooth/bluez/servicemap.cpp
+++ b/src/bluetooth/bluez/servicemap.cpp
@@ -39,6 +39,10 @@
#include "servicemap_p.h"
+QT_BEGIN_NAMESPACE
+
+QT_IMPL_METATYPE_EXTERN(ServiceMap)
+
const QDBusArgument &operator>>(const QDBusArgument &argument, ServiceMap &serviceMap)
{
argument.beginMap();
@@ -59,3 +63,5 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ServiceMap &servi
return argument;
}
+
+QT_END_NAMESPACE
diff --git a/src/bluetooth/bluez/servicemap_p.h b/src/bluetooth/bluez/servicemap_p.h
index 6058fa2e..f09fb996 100644
--- a/src/bluetooth/bluez/servicemap_p.h
+++ b/src/bluetooth/bluez/servicemap_p.h
@@ -51,15 +51,21 @@
// We mean it.
//
+#include <QtBluetooth/qtbluetoothglobal.h>
+
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtDBus/QDBusArgument>
#include <QtCore/private/qglobal_p.h>
+QT_BEGIN_NAMESPACE
+
typedef QMap<quint32, QString> ServiceMap;
const QDBusArgument &operator>>(const QDBusArgument &argument, ServiceMap &serviceMap);
-Q_DECLARE_METATYPE(ServiceMap)
+QT_END_NAMESPACE
+
+QT_DECL_METATYPE_EXTERN(ServiceMap, Q_BLUETOOTH_EXPORT)
#endif // SERVICEMAP_P_H
diff --git a/src/bluetooth/qbluetoothaddress.cpp b/src/bluetooth/qbluetoothaddress.cpp
index e6249ca4..1431b941 100644
--- a/src/bluetooth/qbluetoothaddress.cpp
+++ b/src/bluetooth/qbluetoothaddress.cpp
@@ -45,6 +45,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QBluetoothAddress)
+
/*!
\class QBluetoothAddress
\inmodule QtBluetooth
diff --git a/src/bluetooth/qbluetoothaddress.h b/src/bluetooth/qbluetoothaddress.h
index eaf27e6b..0c18e543 100644
--- a/src/bluetooth/qbluetoothaddress.h
+++ b/src/bluetooth/qbluetoothaddress.h
@@ -93,6 +93,6 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QBluetoothAddress)
+QT_DECL_METATYPE_EXTERN(QBluetoothAddress, Q_BLUETOOTH_EXPORT)
#endif
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
index fa0d7768..85e865e9 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
@@ -90,8 +90,8 @@ QT_END_NAMESPACE
using ManufacturerData = QHash<quint16, QByteArray>;
using ServiceData = QHash<QBluetoothUuid, QByteArray>;
-Q_DECLARE_METATYPE(ManufacturerData)
-Q_DECLARE_METATYPE(ServiceData)
+QT_DECL_METATYPE_EXTERN(ManufacturerData, Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN(ServiceData, Q_BLUETOOTH_EXPORT)
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index 29a11d91..8b0d8082 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -70,6 +70,9 @@ using namespace ABI::Windows::Storage::Streams;
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(ManufacturerData)
+QT_IMPL_METATYPE_EXTERN(ServiceData)
+
Q_DECLARE_LOGGING_CATEGORY(QT_BT_WINDOWS)
#define EMIT_WORKER_ERROR_AND_RETURN_IF_FAILED(msg, error, ret) \
diff --git a/src/bluetooth/qbluetoothdeviceinfo.cpp b/src/bluetooth/qbluetoothdeviceinfo.cpp
index 6937d52f..1c79d717 100644
--- a/src/bluetooth/qbluetoothdeviceinfo.cpp
+++ b/src/bluetooth/qbluetoothdeviceinfo.cpp
@@ -42,6 +42,11 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QBluetoothDeviceInfo)
+#ifdef QT_WINRT_BLUETOOTH
+QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothDeviceInfo::Fields, QBluetoothDeviceInfo__Fields)
+#endif
+
/*!
\class QBluetoothDeviceInfo
\inmodule QtBluetooth
diff --git a/src/bluetooth/qbluetoothdeviceinfo.h b/src/bluetooth/qbluetoothdeviceinfo.h
index 6fd250ec..ef4baec8 100644
--- a/src/bluetooth/qbluetoothdeviceinfo.h
+++ b/src/bluetooth/qbluetoothdeviceinfo.h
@@ -275,9 +275,10 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceInfo::ServiceClasses)
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QBluetoothDeviceInfo)
+QT_DECL_METATYPE_EXTERN(QBluetoothDeviceInfo, Q_BLUETOOTH_EXPORT)
#ifdef QT_WINRT_BLUETOOTH
-Q_DECLARE_METATYPE(QBluetoothDeviceInfo::Fields)
+QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothDeviceInfo::Fields, QBluetoothDeviceInfo__Fields,
+ Q_BLUETOOTH_EXPORT)
#endif
#endif
diff --git a/src/bluetooth/qbluetoothhostinfo.cpp b/src/bluetooth/qbluetoothhostinfo.cpp
index d28cadb9..89f6dc98 100644
--- a/src/bluetooth/qbluetoothhostinfo.cpp
+++ b/src/bluetooth/qbluetoothhostinfo.cpp
@@ -42,6 +42,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QBluetoothHostInfo)
+
/*!
\class QBluetoothHostInfo
\inmodule QtBluetooth
diff --git a/src/bluetooth/qbluetoothhostinfo.h b/src/bluetooth/qbluetoothhostinfo.h
index 9330cba7..f4ce34a6 100644
--- a/src/bluetooth/qbluetoothhostinfo.h
+++ b/src/bluetooth/qbluetoothhostinfo.h
@@ -77,6 +77,6 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QBluetoothHostInfo)
+QT_DECL_METATYPE_EXTERN(QBluetoothHostInfo, Q_BLUETOOTH_EXPORT)
#endif
diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp
index 63db11f9..fa6254f1 100644
--- a/src/bluetooth/qbluetoothlocaldevice.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice.cpp
@@ -45,6 +45,10 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothLocalDevice::Pairing, QBluetoothLocalDevice__Pairing)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothLocalDevice::HostMode, QBluetoothLocalDevice__HostMode)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothLocalDevice::Error, QBluetoothLocalDevice__Error)
+
/*!
\class QBluetoothLocalDevice
\inmodule QtBluetooth
diff --git a/src/bluetooth/qbluetoothlocaldevice.h b/src/bluetooth/qbluetoothlocaldevice.h
index 32feea2e..0da6f54c 100644
--- a/src/bluetooth/qbluetoothlocaldevice.h
+++ b/src/bluetooth/qbluetoothlocaldevice.h
@@ -114,8 +114,11 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QBluetoothLocalDevice::Pairing)
-Q_DECLARE_METATYPE(QBluetoothLocalDevice::HostMode)
-Q_DECLARE_METATYPE(QBluetoothLocalDevice::Error)
+QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothLocalDevice::Pairing, QBluetoothLocalDevice__Pairing,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothLocalDevice::HostMode, QBluetoothLocalDevice__HostMode,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothLocalDevice::Error, QBluetoothLocalDevice__Error,
+ Q_BLUETOOTH_EXPORT)
#endif // QBLUETOOTHLOCALDEVICE_H
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index f7a842b3..ffc33b8c 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -44,6 +44,11 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QBluetoothServiceInfo)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothServiceInfo::Sequence, QBluetoothServiceInfo__Sequence)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothServiceInfo::Alternative,
+ QBluetoothServiceInfo__Alternative)
+
/*!
\class QBluetoothServiceInfo::Sequence
\inmodule QtBluetooth
diff --git a/src/bluetooth/qbluetoothserviceinfo.h b/src/bluetooth/qbluetoothserviceinfo.h
index 991aa864..6e5b5f55 100644
--- a/src/bluetooth/qbluetoothserviceinfo.h
+++ b/src/bluetooth/qbluetoothserviceinfo.h
@@ -161,9 +161,12 @@ protected:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QBluetoothServiceInfo)
-Q_DECLARE_METATYPE(QBluetoothServiceInfo::Sequence)
-Q_DECLARE_METATYPE(QBluetoothServiceInfo::Alternative)
+QT_DECL_METATYPE_EXTERN(QBluetoothServiceInfo, Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothServiceInfo::Sequence, QBluetoothServiceInfo__Sequence,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothServiceInfo::Alternative,
+ QBluetoothServiceInfo__Alternative,
+ Q_BLUETOOTH_EXPORT)
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/qbluetoothsocket_android.cpp b/src/bluetooth/qbluetoothsocket_android.cpp
index 40969e8b..b6ca9090 100644
--- a/src/bluetooth/qbluetoothsocket_android.cpp
+++ b/src/bluetooth/qbluetoothsocket_android.cpp
@@ -57,6 +57,7 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT_ANDROID)
#define FALLBACK_CHANNEL 1
#define USE_FALLBACK true
+// ### Needs to be moved to qjniobject.h in qtbase
Q_DECLARE_METATYPE(QJniObject)
Q_BLUETOOTH_EXPORT bool useReverseUuidWorkAroundConnect = true;
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index afd32e71..0acacf55 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -47,6 +47,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QBluetoothUuid)
+
// Bluetooth base UUID 00000000-0000-1000-8000-00805F9B34FB
// these defines represent the above UUID
// static inline constexpr const uint data1Reference = 0x00000000;
diff --git a/src/bluetooth/qbluetoothuuid.h b/src/bluetooth/qbluetoothuuid.h
index 46504eda..3fec07b9 100644
--- a/src/bluetooth/qbluetoothuuid.h
+++ b/src/bluetooth/qbluetoothuuid.h
@@ -430,6 +430,6 @@ inline QDataStream &operator>>(QDataStream &s, QBluetoothUuid &uuid)
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QBluetoothUuid)
+QT_DECL_METATYPE_EXTERN(QBluetoothUuid, Q_BLUETOOTH_EXPORT)
#endif
diff --git a/src/bluetooth/qlowenergycharacteristic.cpp b/src/bluetooth/qlowenergycharacteristic.cpp
index a0a915e5..153acd40 100644
--- a/src/bluetooth/qlowenergycharacteristic.cpp
+++ b/src/bluetooth/qlowenergycharacteristic.cpp
@@ -43,6 +43,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QLowEnergyCharacteristic)
+
/*!
\class QLowEnergyCharacteristic
\inmodule QtBluetooth
diff --git a/src/bluetooth/qlowenergycharacteristic.h b/src/bluetooth/qlowenergycharacteristic.h
index c11d7355..da5b13c1 100644
--- a/src/bluetooth/qlowenergycharacteristic.h
+++ b/src/bluetooth/qlowenergycharacteristic.h
@@ -126,6 +126,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QLowEnergyCharacteristic::PropertyTypes)
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QLowEnergyCharacteristic)
+QT_DECL_METATYPE_EXTERN(QLowEnergyCharacteristic, Q_BLUETOOTH_EXPORT)
#endif // QLOWENERGYCHARACTERISTIC_H
diff --git a/src/bluetooth/qlowenergyconnectionparameters.cpp b/src/bluetooth/qlowenergyconnectionparameters.cpp
index 5d3719dc..f1604782 100644
--- a/src/bluetooth/qlowenergyconnectionparameters.cpp
+++ b/src/bluetooth/qlowenergyconnectionparameters.cpp
@@ -41,6 +41,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QLowEnergyConnectionParameters)
+
class QLowEnergyConnectionParametersPrivate : public QSharedData
{
public:
diff --git a/src/bluetooth/qlowenergyconnectionparameters.h b/src/bluetooth/qlowenergyconnectionparameters.h
index 81e453aa..57624ae9 100644
--- a/src/bluetooth/qlowenergyconnectionparameters.h
+++ b/src/bluetooth/qlowenergyconnectionparameters.h
@@ -89,6 +89,6 @@ Q_DECLARE_SHARED(QLowEnergyConnectionParameters)
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QLowEnergyConnectionParameters)
+QT_DECL_METATYPE_EXTERN(QLowEnergyConnectionParameters, Q_BLUETOOTH_EXPORT)
#endif // Include guard
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index ff000f80..db3d390a 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -68,6 +68,13 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyController::Error, QLowEnergyController__Error)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyController::ControllerState,
+ QLowEnergyController__ControllerState)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyController::RemoteAddressType,
+ QLowEnergyController__RemoteAddressType)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyController::Role, QLowEnergyController__Role)
+
Q_DECLARE_LOGGING_CATEGORY(QT_BT)
#if defined(QT_ANDROID_BLUETOOTH)
Q_DECLARE_LOGGING_CATEGORY(QT_BT_ANDROID)
diff --git a/src/bluetooth/qlowenergycontroller.h b/src/bluetooth/qlowenergycontroller.h
index bbe58308..4a9baa29 100644
--- a/src/bluetooth/qlowenergycontroller.h
+++ b/src/bluetooth/qlowenergycontroller.h
@@ -166,9 +166,15 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QLowEnergyController::Error)
-Q_DECLARE_METATYPE(QLowEnergyController::ControllerState)
-Q_DECLARE_METATYPE(QLowEnergyController::RemoteAddressType)
-Q_DECLARE_METATYPE(QLowEnergyController::Role)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyController::Error, QLowEnergyController__Error,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyController::ControllerState,
+ QLowEnergyController__ControllerState,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyController::RemoteAddressType,
+ QLowEnergyController__RemoteAddressType,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyController::Role, QLowEnergyController__Role,
+ Q_BLUETOOTH_EXPORT)
#endif // QLOWENERGYCONTROLLER_H
diff --git a/src/bluetooth/qlowenergycontroller_android.cpp b/src/bluetooth/qlowenergycontroller_android.cpp
index 17bab6f3..0f26beff 100644
--- a/src/bluetooth/qlowenergycontroller_android.cpp
+++ b/src/bluetooth/qlowenergycontroller_android.cpp
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(QT_BT_ANDROID)
+// ### Needs to be moved to qjniobject.h in qtbase
Q_DECLARE_METATYPE(QJniObject)
// BT Core v5.3, 3.2.9, Vol 3, Part F
diff --git a/src/bluetooth/qlowenergydescriptor.cpp b/src/bluetooth/qlowenergydescriptor.cpp
index 8b778d19..9bd4c6cb 100644
--- a/src/bluetooth/qlowenergydescriptor.cpp
+++ b/src/bluetooth/qlowenergydescriptor.cpp
@@ -44,6 +44,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QLowEnergyDescriptor)
+
/*!
\class QLowEnergyDescriptor
\inmodule QtBluetooth
diff --git a/src/bluetooth/qlowenergydescriptor.h b/src/bluetooth/qlowenergydescriptor.h
index 220e9dfe..65164f67 100644
--- a/src/bluetooth/qlowenergydescriptor.h
+++ b/src/bluetooth/qlowenergydescriptor.h
@@ -102,6 +102,6 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QLowEnergyDescriptor)
+QT_DECL_METATYPE_EXTERN(QLowEnergyDescriptor, Q_BLUETOOTH_EXPORT)
#endif // QLOWENERGYDESCRIPTOR_H
diff --git a/src/bluetooth/qlowenergyservice.cpp b/src/bluetooth/qlowenergyservice.cpp
index 13a80e87..a899d81d 100644
--- a/src/bluetooth/qlowenergyservice.cpp
+++ b/src/bluetooth/qlowenergyservice.cpp
@@ -53,6 +53,11 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyService::ServiceError, QLowEnergyService__ServiceError)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyService::ServiceState, QLowEnergyService__ServiceState)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyService::ServiceType, QLowEnergyService__ServiceType)
+QT_IMPL_METATYPE_EXTERN_TAGGED(QLowEnergyService::WriteMode, QLowEnergyService__WriteMode)
+
/*!
\class QLowEnergyService
\inmodule QtBluetooth
diff --git a/src/bluetooth/qlowenergyservice.h b/src/bluetooth/qlowenergyservice.h
index 069718b6..26c5510d 100644
--- a/src/bluetooth/qlowenergyservice.h
+++ b/src/bluetooth/qlowenergyservice.h
@@ -166,9 +166,13 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QLowEnergyService::ServiceTypes)
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QLowEnergyService::ServiceError)
-Q_DECLARE_METATYPE(QLowEnergyService::ServiceState)
-Q_DECLARE_METATYPE(QLowEnergyService::ServiceType)
-Q_DECLARE_METATYPE(QLowEnergyService::WriteMode)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyService::ServiceError, QLowEnergyService__ServiceError,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyService::ServiceState, QLowEnergyService__ServiceState,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyService::ServiceType, QLowEnergyService__ServiceType,
+ Q_BLUETOOTH_EXPORT)
+QT_DECL_METATYPE_EXTERN_TAGGED(QLowEnergyService::WriteMode, QLowEnergyService__WriteMode,
+ Q_BLUETOOTH_EXPORT)
#endif // QLOWENERGYSERVICE_H
diff --git a/src/bluetooth/qlowenergyserviceprivate.cpp b/src/bluetooth/qlowenergyserviceprivate.cpp
index 0a401d8d..8bad3e46 100644
--- a/src/bluetooth/qlowenergyserviceprivate.cpp
+++ b/src/bluetooth/qlowenergyserviceprivate.cpp
@@ -43,6 +43,9 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN_TAGGED(QSharedPointer<QLowEnergyServicePrivate>,
+ QSharedPointer_QLowEnergyServicePrivate)
+
QLowEnergyServicePrivate::QLowEnergyServicePrivate(QObject *parent) : QObject(parent) { }
QLowEnergyServicePrivate::~QLowEnergyServicePrivate()
diff --git a/src/bluetooth/qlowenergyserviceprivate_p.h b/src/bluetooth/qlowenergyserviceprivate_p.h
index 33d80bdc..a7aff94c 100644
--- a/src/bluetooth/qlowenergyserviceprivate_p.h
+++ b/src/bluetooth/qlowenergyserviceprivate_p.h
@@ -138,6 +138,8 @@ typedef QHash<QLowEnergyHandle, QLowEnergyServicePrivate::DescData> DescriptorDa
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QSharedPointer<QLowEnergyServicePrivate>)
+QT_DECL_METATYPE_EXTERN_TAGGED(QSharedPointer<QLowEnergyServicePrivate>,
+ QSharedPointer_QLowEnergyServicePrivate,
+ /* not exported */)
#endif // QLOWENERGYSERVICEPRIVATE_P_H
diff --git a/src/nfc/qndefmessage.cpp b/src/nfc/qndefmessage.cpp
index 94141616..5e7d42e5 100644
--- a/src/nfc/qndefmessage.cpp
+++ b/src/nfc/qndefmessage.cpp
@@ -42,6 +42,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QNdefMessage)
+
/*!
\class QNdefMessage
\brief The QNdefMessage class provides an NFC NDEF message.
diff --git a/src/nfc/qndefmessage.h b/src/nfc/qndefmessage.h
index ef051afd..39101c99 100644
--- a/src/nfc/qndefmessage.h
+++ b/src/nfc/qndefmessage.h
@@ -69,6 +69,6 @@ public:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QNdefMessage)
+QT_DECL_METATYPE_EXTERN(QNdefMessage, Q_NFC_EXPORT)
#endif // QNDEFMESSAGE_H
diff --git a/src/nfc/qnearfieldtarget.cpp b/src/nfc/qnearfieldtarget.cpp
index d555a7e9..0f529740 100644
--- a/src/nfc/qnearfieldtarget.cpp
+++ b/src/nfc/qnearfieldtarget.cpp
@@ -50,6 +50,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN_TAGGED(QNearFieldTarget::RequestId, QNearFieldTarget__RequestId)
+
/*!
\class QNearFieldTarget
\brief The QNearFieldTarget class provides an interface for communicating with a target
diff --git a/src/nfc/qnearfieldtarget.h b/src/nfc/qnearfieldtarget.h
index d82410dc..bc8475f4 100644
--- a/src/nfc/qnearfieldtarget.h
+++ b/src/nfc/qnearfieldtarget.h
@@ -159,6 +159,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QNearFieldTarget::AccessMethods)
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QNearFieldTarget::RequestId)
+QT_DECL_METATYPE_EXTERN_TAGGED(QNearFieldTarget::RequestId, QNearFieldTarget__RequestId,
+ Q_NFC_EXPORT)
#endif // QNEARFIELDTARGET_H