本文整理汇总了C++中Loader::setProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ Loader::setProxy方法的具体用法?C++ Loader::setProxy怎么用?C++ Loader::setProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::setProxy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventActivated
void CaptchaFormsPlugin::eventActivated(const QString& from)
{
int index = findChalleng("sender", from);
if(index == -1)
return;
QHash<QString, QString> dataFields = challenges_.at(index);
QString id = dataFields.value("id");
QPointer<CaptchaDialog> cd = new CaptchaDialog(id);
cd->setBody(dataFields.value("body"));
cd->setQuestion(dataFields.value("label"));
connect(cd, SIGNAL(ok(QString, QString)), this, SLOT(submitChallenge(QString, QString)));
connect(cd, SIGNAL(cancel(QString)), this, SLOT(cancelChallenge(QString)));
dialogs_[id] = cd;
if(dataFields.contains("data")) {
QByteArray ba;
ba.append(dataFields.value("data"));
QPixmap pix = QPixmap::fromImage(QImage::fromData(QByteArray::fromBase64(ba)));
cd->setPixmap(pix);
}
else {
Loader *ld = new Loader(id, this);
if(useProxy) {
int acc = dataFields.value("account").toInt();
QString host_ = accInfo->proxyHost(acc);
if(!host_.isEmpty()) {
ld->setProxy(host_, accInfo->proxyPort(acc), accInfo->proxyUser(acc), accInfo->proxyPassword(acc));
}
}
else {
Proxy p = appInfo->getProxyFor(name());
ld->setProxy(p.host, p.port, p.user, p.pass);
}
QString url = dataFields.value("uri");
if(url.isEmpty()) {
QString str = dataFields.value("body");
QRegExp re(".*(http://[^\"]+).*");
if(re.indexIn(str) != -1)
url = re.cap(1) + "/image";
}
ld->start(url);
connect(ld, SIGNAL(data(QString,QByteArray)), SLOT(loaderData(QString, QByteArray)));
connect(ld, SIGNAL(error(QString)), SLOT(loaderError(QString)));
}
cd->show();
}