Add QDebug support for QRestAccessManager
Task-number: QTBUG-114705 Change-Id: Id33dbfd6906989dfcde654a4f7d6ab4b5e743c33 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
0f34316fb7
commit
b72701a690
@ -566,6 +566,28 @@ std::chrono::milliseconds QRestAccessManager::transferTimeout() const
|
|||||||
return d->qnam->transferTimeoutAsDuration();
|
return d->qnam->transferTimeoutAsDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
/*!
|
||||||
|
\fn QDebug QRestAccessManager::operator<<(QDebug debug,
|
||||||
|
const QRestAccessManager &manager)
|
||||||
|
|
||||||
|
Writes \a manager into \a debug stream.
|
||||||
|
|
||||||
|
\sa {Debugging Techniques}
|
||||||
|
*/
|
||||||
|
QDebug operator<<(QDebug debug, const QRestAccessManager &manager)
|
||||||
|
{
|
||||||
|
const QDebugStateSaver saver(debug);
|
||||||
|
debug.resetFormat().nospace();
|
||||||
|
|
||||||
|
debug << "QRestAccessManager(deletesRepliesOnFinished = " << manager.deletesRepliesOnFinished()
|
||||||
|
<< ", transferTimeout = " << manager.transferTimeout()
|
||||||
|
<< ", active requests = " << manager.d_func()->activeRequests.size()
|
||||||
|
<< ")";
|
||||||
|
return debug;
|
||||||
|
}
|
||||||
|
#endif // QT_NO_DEBUG_STREAM
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the underlying QNetworkAccessManager instance. The instance
|
Returns the underlying QNetworkAccessManager instance. The instance
|
||||||
can be used for accessing less-frequently used features and configurations.
|
can be used for accessing less-frequently used features and configurations.
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
class QDebug;
|
||||||
class QRestReply;
|
class QRestReply;
|
||||||
|
|
||||||
#define QREST_METHOD_WITH_DATA(METHOD, DATA) \
|
#define QREST_METHOD_WITH_DATA(METHOD, DATA) \
|
||||||
@ -103,6 +104,9 @@ Q_SIGNALS:
|
|||||||
void requestFinished(QRestReply *reply);
|
void requestFinished(QRestReply *reply);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QRestAccessManager &manager);
|
||||||
|
#endif
|
||||||
Q_DECLARE_PRIVATE(QRestAccessManager)
|
Q_DECLARE_PRIVATE(QRestAccessManager)
|
||||||
Q_DISABLE_COPY(QRestAccessManager)
|
Q_DISABLE_COPY(QRestAccessManager)
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user