qnetworkreply

Qt: connect a signal after a request is sent in QNetworkAccessManager [duplicate]

风格不统一 提交于 2019-12-22 14:54:46
问题 This question already has an answer here : Qt signal slot connection - QNetworkAccessManager (1 answer) Closed 4 years ago . I was checking some simple examples of using QNetworkAccessManager and I found this (Assuming that manager is a QNetworkAccessManager: QNetworkRequest request; request.setUrl(QUrl("http://www.someserver.com")); QNetworkReply *reply = manager->get(request); connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); connect(reply, SIGNAL(error(QNetworkReply:

Qt QNetworkAccessManager long delay to emit finished signal

醉酒当歌 提交于 2019-12-11 10:35:51
问题 I use a QNAM to handle uploads using a ftp protocol. The whole process works but I have a strange behavior: this is my method : void ftp::uploadFile(const QString &origin, const QString &destination) { QUrl url("ftp://"+host+""+destination); url.setUserName(user); url.setPassword(pwd); url.setPort(21); localFile = new QFile(origin, this); if (localFile->open(QIODevice::ReadOnly)) { reply = nam->put(QNetworkRequest(url), localFile); QObject::connect(reply, SIGNAL(uploadProgress(qint64, qint64)

QNetworkAccessManager one instance and connecting slots

六月ゝ 毕业季﹏ 提交于 2019-12-08 04:18:42
问题 I have my first Qt application in development. It's a desktop client for site messaging. Qt documentation says that i need to have only one instance of QNetworkAccessManager accross application. But i also read that using of singletons with Qt isn't a good idea. How i can make one instance of QNetworkAccessManager across app? Another question is how to properly connect slots while i call ApiHandler functions from other classes? For example i have ExampleApi class which uses functions of

Qt: connect a signal after a request is sent in QNetworkAccessManager [duplicate]

馋奶兔 提交于 2019-12-06 10:21:25
This question already has an answer here : Qt signal slot connection - QNetworkAccessManager (1 answer) Closed 4 years ago . I was checking some simple examples of using QNetworkAccessManager and I found this (Assuming that manager is a QNetworkAccessManager: QNetworkRequest request; request.setUrl(QUrl("http://www.someserver.com")); QNetworkReply *reply = manager->get(request); connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotError(QNetworkReply::NetworkError))); connect(reply, SIGNAL(sslErrors(QList