如何终止qnetworkaccessmanager 所有的请求
1个回答
展开全部
void QNetworkReplyHttpImplPrivate::postRequest()
{
Q_Q(QNetworkReplyHttpImpl);
QThread *thread = 0;
if (synchronous) {
// A synchronous HTTP request uses its own thread
thread = new QThread();
thread->setObjectName(QStringLiteral("Qt HTTP synchronous thread"));
QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
} else if (!managerPrivate->httpThread) {
// We use the manager-global thread.
// At some point we could switch to having multiple threads if it makes sense.
managerPrivate->httpThread = new QThread();
managerPrivate->早耐汪httpThread->setObjectName(QStringLiteral("陆仔Qt HTTP thread"));
managerPrivate->httpThread->start();
thread = managerPrivate->httpThread;
} else {
// Asynchronous request, thread already exists
thread = managerPrivate->httpThread;
}
..........
// Move the delegate to the http thread
delegate->亩枯moveToThread(thread);
// This call automatically moves the uploadDevice too for the asynchronous case.
...........
}
{
Q_Q(QNetworkReplyHttpImpl);
QThread *thread = 0;
if (synchronous) {
// A synchronous HTTP request uses its own thread
thread = new QThread();
thread->setObjectName(QStringLiteral("Qt HTTP synchronous thread"));
QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
} else if (!managerPrivate->httpThread) {
// We use the manager-global thread.
// At some point we could switch to having multiple threads if it makes sense.
managerPrivate->httpThread = new QThread();
managerPrivate->早耐汪httpThread->setObjectName(QStringLiteral("陆仔Qt HTTP thread"));
managerPrivate->httpThread->start();
thread = managerPrivate->httpThread;
} else {
// Asynchronous request, thread already exists
thread = managerPrivate->httpThread;
}
..........
// Move the delegate to the http thread
delegate->亩枯moveToThread(thread);
// This call automatically moves the uploadDevice too for the asynchronous case.
...........
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询