本文整理汇总了C++中requestFinished函数的典型用法代码示例。如果您正苦于以下问题:C++ requestFinished函数的具体用法?C++ requestFinished怎么用?C++ requestFinished使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requestFinished函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: connect
void DownloadItem::init() {
if (!m_reply)
return;
if (m_file.exists())
m_file.remove();
m_status = Starting;
m_startedSaving = false;
m_finishedDownloading = false;
// attach to the m_reply
m_url = m_reply->url();
connect(m_reply, SIGNAL(readyRead()), this, SLOT(downloadReadyRead()));
connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(error(QNetworkReply::NetworkError)));
connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)),
this, SLOT(downloadProgress(qint64, qint64)));
connect(m_reply, SIGNAL(metaDataChanged()),
this, SLOT(metaDataChanged()));
connect(m_reply, SIGNAL(finished()),
this, SLOT(requestFinished()));
// start timer for the download estimation
m_totalTime = 0;
m_downloadTime.start();
speedCheckTimer->start();
if (m_reply->error() != QNetworkReply::NoError) {
error(m_reply->error());
requestFinished();
}
}
开发者ID:PyPavel,项目名称:minitube,代码行数:34,代码来源:downloaditem.cpp
示例2: URL
TrackerClient::TrackerClient(const QUrl &URL, const QByteArray &infoHash, const TrackerClientManager *manager, TrackerClientSocket *socket)
: URL(URL), key(Utility::rand(Q_INT64_C(0xffffffff))), infoHash(infoHash),
manager(manager), socket(socket),
minimalRequestInterval(defaultMinimalRequestInterval),
requestTimer(startTimer(defaultRequestInterval)), running(false)
{
connect(dynamic_cast<QObject*>(socket), SIGNAL(requestFinished(QByteArray)), SLOT(requestFinished(QByteArray)));
}
开发者ID:Etrnls,项目名称:evangel,代码行数:8,代码来源:trackerclient.cpp
示例3: connect
void CommentsModel::getComments(int offset, int count)
{
if (m_session.data() && m_postId) {
auto reply = m_session.data()->getComments(offset, count);
connect(reply, SIGNAL(resultReady(QVariant)), SIGNAL(requestFinished()));
}
}
开发者ID:Krasnogorov,项目名称:vreen,代码行数:7,代码来源:commentsmodel.cpp
示例4: qWarning
int JsonDbPartition::create(const QJSValue &object, const QJSValue &options, const QJSValue &callback)
{
QJSValue actualOptions = options;
QJSValue actualCallback = callback;
if (options.isCallable()) {
if (!callback.isUndefined()) {
qWarning() << "Callback should be the last parameter.";
return -1;
}
actualCallback = actualOptions;
actualOptions = QJSValue(QJSValue::UndefinedValue);
}
//#TODO ADD options
QVariant obj = qjsvalue_to_qvariant(object);
QJsonDbWriteRequest *request(0);
if (obj.type() == QVariant::List) {
request = new QJsonDbCreateRequest(qvariantlist_to_qjsonobject_list(obj.toList()));
} else {
request = new QJsonDbCreateRequest(QJsonObject::fromVariantMap(obj.toMap()));
}
request->setPartition(_name);
connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
connect(request, SIGNAL(finished()), request, SLOT(deleteLater()));
connect(request, SIGNAL(error(QtJsonDb::QJsonDbRequest::ErrorCode,QString)),
this, SLOT(requestError(QtJsonDb::QJsonDbRequest::ErrorCode,QString)));
connect(request, SIGNAL(error(QtJsonDb::QJsonDbRequest::ErrorCode,QString)),
request, SLOT(deleteLater()));
JsonDatabase::sharedConnection().send(request);
writeCallbacks.insert(request, actualCallback);
return request->property("requestId").toInt();
}
开发者ID:Distrotech,项目名称:qtjsondb,代码行数:31,代码来源:jsondbpartition.cpp
示例5: connect
void MyWebView::initEvents()
{
// 委托页面所有连接在当前视图中打开
myPage->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(myPage, SIGNAL(linkClicked(QUrl)), this, SLOT(onOpenUrl(QUrl)));
// 对所有事件添加信号槽
connect(myFrame, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));
connect(myFrame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(onJavaScriptWindowObjectCleared()));
connect(myFrame, SIGNAL(initialLayoutCompleted()), this, SLOT(onInitialLayoutCompleted()));
connect(myFrame, SIGNAL(pageChanged()), this, SLOT(onPageChanged()));
connect(myFrame, SIGNAL(contentsSizeChanged(const QSize)), this, SLOT(onContentsSizeChanged(const QSize)));
connect(myFrame, SIGNAL(iconChanged()), this, SLOT(onIconChanged()));
connect(myFrame, SIGNAL(loadStarted()), this, SLOT(onLoadStarted()));
connect(myFrame, SIGNAL(titleChanged(const QString)), this, SLOT(onTitleChanged(const QString)));
connect(myFrame, SIGNAL(urlChanged(const QUrl)), this, SLOT(onUrlChanged(const QUrl)));
connect(myPage, SIGNAL(loadProgress(int)), this, SLOT(onLoadProgress(int)));
connect(myPage, SIGNAL(repaintRequested(const QRect)), this, SLOT(onRepaintRequested(const QRect)));
connect(myPage, SIGNAL(geometryChangeRequested(const QRect)), this, SLOT(onGeometryChangeRequested(const QRect)));
connect(newManager, SIGNAL(requestFinished(QString)),
this, SLOT(onRequestFinished(QString)));
connect(newManager, SIGNAL(requestStart(QString)),
this, SLOT(onRequestStart(QString)));
};
开发者ID:leeight,项目名称:berserkJS,代码行数:26,代码来源:mywebview.cpp
示例6: if
/*!
* \brief DocumentationViewer::processLinkClick
* \param url
* Slot activated when linkClicked signal of webview is raised.
* Handles the link processing. Sends all the http starting links to the QDesktopServices and process all Modelica starting links.
*/
void DocumentationViewer::processLinkClick(QUrl url)
{
// Send all http requests to desktop services for now.
// if url contains http or mailto: send it to desktop services
if ((url.toString().startsWith("http")) || (url.toString().startsWith("mailto:"))) {
QDesktopServices::openUrl(url);
} else if (url.scheme().compare("modelica") == 0) { // if the user has clicked on some Modelica Links like modelica://
// remove modelica:/// from Qurl
QString resourceLink = url.toString().mid(12);
/* if the link is a resource e.g .html, .txt or .pdf */
if (resourceLink.endsWith(".html") || resourceLink.endsWith(".txt") || resourceLink.endsWith(".pdf")) {
QString resourceAbsoluteFileName = mpDocumentationWidget->getMainWindow()->getOMCProxy()->uriToFilename("modelica://" + resourceLink);
QDesktopServices::openUrl("file:///" + resourceAbsoluteFileName);
} else {
LibraryTreeItem *pLibraryTreeItem = mpDocumentationWidget->getMainWindow()->getLibraryWidget()->getLibraryTreeModel()->findLibraryTreeItem(resourceLink);
// send the new className to DocumentationWidget
if (pLibraryTreeItem) {
mpDocumentationWidget->showDocumentation(pLibraryTreeItem);
}
}
} else { // if it is normal http request then check if its not redirected to https
QNetworkAccessManager* accessManager = page()->networkAccessManager();
QNetworkRequest request(url);
QNetworkReply* reply = accessManager->get(request);
connect(reply, SIGNAL(finished()), SLOT(requestFinished()));
}
}
开发者ID:hkiel,项目名称:OMEdit,代码行数:33,代码来源:DocumentationWidget.cpp
示例7: refresh
void MusicCollector::loadList()
{
if (playlistId == 0) {
if (nextOperation == OperationNone) {
nextOperation = OperationLoadPlaylist;
operatingId.clear();
}
if (!currentReply || currentReply->property(KeyOperation).toInt() != OperationLoadPid) {
refresh();
}
return;
}
if (currentReply && currentReply->isRunning())
currentReply->abort();
QUrl url(QString(ApiBaseUrl).append("/v2/playlist/detail"));
url.addEncodedQueryItem("id", QByteArray::number(playlistId));
url.addEncodedQueryItem("t", "-1");
url.addEncodedQueryItem("n", "1000");
url.addEncodedQueryItem("s", "0");
checkNAM();
currentReply = manager->get(QNetworkRequest(url));
currentReply->setProperty(KeyOperation, OperationLoadPlaylist);
connect(currentReply, SIGNAL(finished()), SLOT(requestFinished()), Qt::QueuedConnection);
emit loadingChanged();
}
开发者ID:SunRain,项目名称:cloudmusicqt,代码行数:32,代码来源:musiccollector.cpp
示例8: XQServiceRequest
/*!
* Uses Qt Highway to send 'addWidget' request to home screen application.
* \a uri and \a preferences as in widget model.
*/
void HsHomescreenClient::doAddWidget(
const QString &uri,
const QVariantHash &preferences)
{
delete mAsyncRequest;
mAsyncRequest = 0;
mAsyncRequest = new XQServiceRequest(INTERFACE_NAME,
"addWidget(QString,QVariantHash)", false);
XQRequestInfo requestInfo = mAsyncRequest->info();
requestInfo.setBackground(true);
mAsyncRequest->setInfo(requestInfo);
*mAsyncRequest << uri;
*mAsyncRequest << preferences;
connect(mAsyncRequest, SIGNAL(requestCompleted(QVariant)),
SLOT(onRequestCompleted(QVariant)));
connect(mAsyncRequest, SIGNAL(requestError(int)),
SLOT(onRequestError(int)));
mRequestResult = false;
if (!mAsyncRequest->send()) {
emit requestFinished();
}
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:30,代码来源:hshomescreenclient.cpp
示例9: url
void UpdateChecker::checkForUpdate() {
QUrl url(QLatin1String(Constants::WEBSITE) + "-ws/release.xml");
{
QUrlQueryHelper urlHelper(url);
urlHelper.addQueryItem("v", Constants::VERSION);
#ifdef APP_MAC
urlHelper.addQueryItem("os", "mac");
#endif
#ifdef APP_WIN
urlHelper.addQueryItem("os", "win");
#endif
#ifdef APP_ACTIVATION
QString t = "demo";
if (Activation::instance().isActivated()) t = "active";
urlHelper.addQueryItem("t", t);
#endif
#ifdef APP_MAC_STORE
urlHelper.addQueryItem("store", "mac");
#endif
}
QObject *reply = The::http()->get(url);
connect(reply, SIGNAL(data(QByteArray)), SLOT(requestFinished(QByteArray)));
}
开发者ID:Gira-X,项目名称:minitube,代码行数:27,代码来源:updatechecker.cpp
示例10: Q_ASSERT
void Cinema::initFromXml(const QDomElement& e)
{
Q_ASSERT(e.tagName() == "cinema");
clear();
id_ = XMLHelper::subTagText(e, "id");
name_ = XMLHelper::subTagText(e, "name");
address_ = XMLHelper::subTagText(e, "address");
metro_ = XMLHelper::subTagText(e, "metro");
details_ = XMLHelper::subTagText(e, "details");
ll_ = XMLHelper::subTagText(e, "ll");
if (!e.attribute("detailed").isEmpty()) {
hasDetailedInfo_ = true;
finishedProgress_ = 50;
if (!address_.isEmpty() && ll_.isEmpty() && !XMLHelper::hasSubTag(e, "ll")) {
Geocoder* geocoder = new Geocoder(QString("%1_geocoder_%2")
.arg(AfishaHelpers::cinemaCacheDate())
.arg(id_), this);
request_ = geocoder;
connect(geocoder, SIGNAL(finished()), SLOT(requestFinished()));
geocoder->request(address_);
}
else {
finishedProgress_ = 100;
}
// if (!details_.isEmpty())
// qWarning() << id_ << name_ << address_ << metro_;
}
emit dataChanged();
}
开发者ID:mblsha,项目名称:afisha-cinema,代码行数:34,代码来源:cinema.cpp
示例11: Q_ASSERT
void MediaDownloadTask::start(const QUrl &url, const QList<QNetworkCookie> &cookies, unsigned position,
unsigned size)
{
Q_ASSERT(!m_reply);
if (!threadNAM.hasLocalData())
{
threadNAM.setLocalData(new QNetworkAccessManager);
/* XXX certificate validation */
}
threadNAM.localData()->cookieJar()->setCookiesFromUrl(cookies, url);
if (threadNAM.localData()->cookieJar()->cookiesForUrl(url).isEmpty())
qDebug() << "MediaDownload: No cookies for media URL, likely to fail authentication";
QNetworkRequest req(url);
if (position || size)
{
QByteArray range = "bytes=" + QByteArray::number(position) + "-";
if (size)
range += QByteArray::number(position + size);
req.setRawHeader("Range", range);
}
m_writePos = position;
m_reply = threadNAM.localData()->get(req);
m_reply->ignoreSslErrors(); // XXX Do this properly!
connect(m_reply, SIGNAL(metaDataChanged()), SLOT(metaDataReady()));
connect(m_reply, SIGNAL(readyRead()), SLOT(read()));
connect(m_reply, SIGNAL(finished()), SLOT(requestFinished()));
}
开发者ID:chenbk85,项目名称:bluecherry-client,代码行数:32,代码来源:MediaDownload.cpp
示例12: requestStart
QNetworkReply* NetworkAccessManager::createRequest(QNetworkAccessManager::Operation operation,
const QNetworkRequest &request, QIODevice *device)
{
qint64 time;
if (isListener) {
time = QDateTime::currentDateTime().toMSecsSinceEpoch();
}
QNetworkReply *reply = QNetworkAccessManager::createRequest(operation, request, device);
reply->ignoreSslErrors();
if (isListener) {
// 触发请求开始的自定义信号
emit requestStart(request.url().toString());
// 不清除这个指针
// TODO: 该类由 webview 接管处理
CustomDownload* customDownload = new CustomDownload(reply, request,
QDateTime::currentDateTime().toMSecsSinceEpoch() - time,
time);
connect(customDownload, SIGNAL(requestFinished(QString)),
this, SLOT(onRequestFinished(QString)));
}
return reply;
}
开发者ID:Dawn-King,项目名称:berserkJS,代码行数:27,代码来源:networkaccessmanager.cpp
示例13: connect
void NewsFeedModel::getNews(int filters, quint8 count, int offset)
{
if (m_newsFeed.isNull())
return;
auto reply = m_newsFeed.data()->getNews(static_cast<Vreen::NewsFeed::Filters>(filters), count, offset);
connect(reply, SIGNAL(resultReady(QVariant)), SIGNAL(requestFinished()));
}
开发者ID:Krasnogorov,项目名称:vreen,代码行数:8,代码来源:newsfeedmodel.cpp
示例14: qDebug
void SM_QDropbox::networkReplyFinished(QNetworkReply *rply)
{
#ifdef SM_QTDROPBOX_DEBUG
qDebug() << "reply finished" << endl;
#endif
int reqnr = replynrMap[rply];
requestFinished(reqnr, rply);
rply->deleteLater(); // release memory
}
开发者ID:AdrianBZG,项目名称:SyncMe,代码行数:9,代码来源:SM_qdropbox.cpp
示例15: QPlaceReply
CategoryInitReply::CategoryInitReply(QPlaceManagerEngineJsonDb *engine)
: QPlaceReply(engine),
m_engine(engine),
m_traverser(new CategoryTraverser(m_engine->db(), this))
{
Q_ASSERT(m_traverser);
connect(m_traverser, SIGNAL(finished()),
this, SLOT(requestFinished()));
}
开发者ID:amccarthy,项目名称:qtlocation,代码行数:9,代码来源:initreply.cpp
示例16: spy
void
Ut_AboutBusinessLogic::testBluetooth ()
{
QSignalSpy spy (
m_Api,
SIGNAL (requestFinished (AboutBusinessLogic::requestType, QVariant)));
QMap <QString, QVariant> properties;
properties["Address"] = QString ("fake-bluetooth-address");
/*
* Let's initiate the Bluetooth query that will call the
* QDBusAbstractInterface::callWithCallback() that is stubbed.
*/
m_Api->initiateBluetoothQueries ();
QCOMPARE (lastCalledMethod, QString ("DefaultAdapter"));
/*
* Let's answer the previous step by calling the DBus callback manually.
* This will initiate an other DBus call also stubbed.
*/
m_Api->defaultBluetoothAdapterReceived (
QDBusObjectPath("/fakeObjectPath"));
QCOMPARE (lastCalledMethod, QString ("GetProperties"));
/*
* Answering the second DBus call and checking if the businesslogic
* processed the data as it should.
*/
m_Api->defaultBluetoothAdapterAddressReceived (properties);
QTest::qWait (100);
QCOMPARE (spy.count (), 1);
QList<QVariant> args = spy.first ();
QCOMPARE (args.at (0).value<AboutBusinessLogic::requestType>(),
AboutBusinessLogic::reqBtAddr);
#if 0
/* for some strange reason it is not working :-S */
QCOMPARE (args.at (1).toString (), QString ("fake-bluetooth-address"));
#endif
/*
* Let's test the failure socket. This does not do nothing...
*/
m_Api->DBusMessagingFailure (QDBusError());
delete m_Api;
/*
* Let's see what happens if we initate the data collection and instead of
* producing answers to queries we just destroy the object.
*/
m_Api = new AboutBusinessLogic;
m_Api->initiateBluetoothQueries ();
//XXX: delete m_Api; (done in cleanup ())
}
开发者ID:deztructor,项目名称:meegotouch-controlpanelapplets,代码行数:57,代码来源:ut_aboutbusinesslogic.cpp
示例17: Q_D
void QQuickImageBase::load()
{
Q_D(QQuickImageBase);
if (d->url.isEmpty()) {
d->pix.clear(this);
if (d->progress != 0.0) {
d->progress = 0.0;
emit progressChanged(d->progress);
}
pixmapChange();
d->status = Null;
emit statusChanged(d->status);
if (sourceSize() != d->oldSourceSize) {
d->oldSourceSize = sourceSize();
emit sourceSizeChanged();
}
update();
} else {
QQuickPixmap::Options options;
if (d->async)
options |= QQuickPixmap::Asynchronous;
if (d->cache)
options |= QQuickPixmap::Cache;
d->pix.clear(this);
d->pix.load(qmlEngine(this), d->url, d->sourcesize, options);
if (d->pix.isLoading()) {
if (d->progress != 0.0) {
d->progress = 0.0;
emit progressChanged(d->progress);
}
if (d->status != Loading) {
d->status = Loading;
emit statusChanged(d->status);
}
static int thisRequestProgress = -1;
static int thisRequestFinished = -1;
if (thisRequestProgress == -1) {
thisRequestProgress =
QQuickImageBase::staticMetaObject.indexOfSlot("requestProgress(qint64,qint64)");
thisRequestFinished =
QQuickImageBase::staticMetaObject.indexOfSlot("requestFinished()");
}
d->pix.connectFinished(this, thisRequestFinished);
d->pix.connectDownloadProgress(this, thisRequestProgress);
update(); //pixmap may have invalidated texture, updatePaintNode needs to be called before the next repaint
} else {
requestFinished();
}
}
}
开发者ID:SamuelNevala,项目名称:qtdeclarative,代码行数:56,代码来源:qquickimagebase.cpp
示例18: connect
// Request methods
void CommunicationDescriptionGateway::setupRequestConnections() {
// this->disconnect();
connect(networkRequest, SIGNAL(responseDownloaded(QByteArray)), this, SLOT(requestReceived(QByteArray)));
connect(networkRequest, SIGNAL(finished()), this, SLOT(requestFinished()));
connect(networkRequest, SIGNAL(authenticationChallenge()), this, SLOT(authenticationChallenge()));
// failed connections
connect(networkRequest, SIGNAL(failedToSendRequest()), this, SLOT(requestFailed()));
connect(networkRequest, SIGNAL(noNetworkConnection()), this, SLOT(requestFailed()));
connect(networkRequest, SIGNAL(requestTimedOut()), this, SLOT(requestFailed()));
}
开发者ID:Bitfall,项目名称:AppWhirr-client,代码行数:11,代码来源:communicationdescriptiongateway.cpp
示例19: FacebookReply
/*!
\internal
Executes the request.
*/
bool FacebookRequest::executeRequest()
{
if (m_graphPath.isEmpty()) {
FacebookReply *facebookReply =
new FacebookReply(QByteArray(), true, FacebookReply::OAuthGeneralError,
"Facebook error. Invalid graph path.", this);
emit requestFinished(this, facebookReply);
delete facebookReply;
return false;
}
bool ret = true;
QNetworkRequest request(Util::generateUrl(m_graphPath, m_parameters));
qDebug() << "FacebookRequest::executeRequest - URL:" << request.url();
switch (m_method) {
case FacebookConnection::HTTPPost:
request.setRawHeader("Content-Type",
QString("multipart/form-data; boundary=%1")
.arg(Boundary).toAscii());
m_ongoingRequest = m_networkAccess->post(request, Util::generateBody(m_parameters));
break;
case FacebookConnection::HTTPGet:
m_ongoingRequest = m_networkAccess->get(request);
break;
case FacebookConnection::HTTPDelete:
m_ongoingRequest = m_networkAccess->deleteResource(request);
break;
default: {
FacebookReply *facebookReply =
new FacebookReply(QByteArray(), true,
FacebookReply::OAuthGeneralError,
"Facebook error. Invalid request method.",
this);
emit requestFinished(this, facebookReply);
delete facebookReply;
ret = false;
}
}
return ret;
}
开发者ID:paoletto,项目名称:social-connect-qml-plugin,代码行数:48,代码来源:facebookrequest.cpp
示例20: searchTotoz
void QQTMRequester::parsingFinished()
{
m_totozes.append(m_xmlParser->totozes());
if(m_xmlParser->numResults() > 0 &&
m_totozes.size() < m_xmlParser->numResults())
searchTotoz(m_currKey, m_totozes.size());
else
emit requestFinished();
}
开发者ID:claudex,项目名称:quteqoin,代码行数:10,代码来源:qqtmrequester.cpp
注:本文中的requestFinished函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论