summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothuuid.h
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2021-03-11 09:48:50 +0100
committerAndreas Buhr <andreas@andreasbuhr.de>2021-03-12 21:43:11 +0100
commite2e01feeaa124f3d1557278538a8f8cc7ae60216 (patch)
treeb5d3822e511684016eac84b5a8e5f3e065f9b2b2 /src/bluetooth/qbluetoothuuid.h
parent9c59558afc71f36a82a1cab9ca0841119892e26a (diff)
Make streaming operators hidden friends in QtBluetooth
This patch changes all streaming operators in QtBluetooth to hidden friends. Thereby, they can only be found through ADL, not polluting the global namespace. Fixes: QTBUG-91554 Change-Id: I757687ff177dc4d7efad53c9125ba4b6bfe2d950 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothuuid.h')
-rw-r--r--src/bluetooth/qbluetoothuuid.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/bluetooth/qbluetoothuuid.h b/src/bluetooth/qbluetoothuuid.h
index e1970475..af98c71b 100644
--- a/src/bluetooth/qbluetoothuuid.h
+++ b/src/bluetooth/qbluetoothuuid.h
@@ -393,6 +393,13 @@ public:
return static_cast<QUuid>(a) == static_cast<QUuid>(b);
}
friend bool operator!=(const QBluetoothUuid &a, const QBluetoothUuid &b) { return !(a == b); }
+#ifndef QT_NO_DEBUG_STREAM
+ friend QDebug operator<<(QDebug debug, const QBluetoothUuid &uuid)
+ {
+ return streamingoperator(debug, uuid);
+ }
+ static QDebug streamingoperator(QDebug debug, const QBluetoothUuid &uuid);
+#endif
int minimumSize() const;
@@ -421,15 +428,6 @@ inline QDataStream &operator>>(QDataStream &s, QBluetoothUuid &uuid)
}
#endif
-#ifndef QT_NO_DEBUG_STREAM
-/// TODO: Move implementation to .cpp, uninline and add Q_BLUETOOTH_EXPORT for Qt 6
-inline QDebug operator<<(QDebug debug, const QBluetoothUuid &uuid)
-{
- debug << uuid.toString();
- return debug;
-}
-#endif
-
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QBluetoothUuid)