mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 15:37:23 +00:00
19 lines
345 B
C++
19 lines
345 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()
|
|
{
|
|
auto reply = dynamic_cast<QNetworkReply *>(parent());
|
|
if (reply->isRunning())
|
|
reply->close();
|
|
}
|