如何终止qnetworkaccessmanager 所有的请求

 我来答
lygrrz1314
2016-08-21 · TA获得超过219个赞
知道小有建树答主
回答量:148
采纳率:0%
帮助的人:140万
展开全部
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.

...........
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式