mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 15:37:23 +00:00
19 lines
354 B
C++
19 lines
354 B
C++
#include "qreplytimeout.h"
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
QReplyTimeout::QReplyTimeout(QNetworkReply *reply, const int timeout)
|
|
: QObject(reply)
|
|
{
|
|
QTimer::singleShot(timeout, this, SLOT(timeout()));
|
|
}
|
|
|
|
|
|
void QReplyTimeout::timeout()
|
|
{
|
|
QNetworkReply *reply = static_cast<QNetworkReply *>(parent());
|
|
if (reply->isRunning())
|
|
reply->close();
|
|
}
|