diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index b8ba9fcd07..ddde994a6e 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -931,17 +931,32 @@ static inline QDebug flagsDebug(QDebug debug, QNetworkInterface::InterfaceFlags return debug; } -static inline QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry) +/*! + \since 6.2 + + Writes the QNetworkAddressEntry \a entry to the stream and + returns a reference to the stream. + + \relates QNetworkAddressEntry + */ +QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry) { - debug << "(address = " << entry.ip(); + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); + debug << "address = " << entry.ip(); if (!entry.netmask().isNull()) debug << ", netmask = " << entry.netmask(); if (!entry.broadcast().isNull()) debug << ", broadcast = " << entry.broadcast(); - debug << ')'; return debug; } +/*! + Writes the QNetworkInterface \a networkInterface to the stream and + returns a reference to the stream. + + \relates QNetworkInterface + */ QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface) { QDebugStateSaver saver(debug); diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index b96ca0e5fa..ef4dce1c01 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -176,6 +176,7 @@ Q_DECLARE_SHARED(QNetworkInterface) Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkInterface::InterfaceFlags) #ifndef QT_NO_DEBUG_STREAM +Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry); Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface); #endif