#include "network.h"Network::Network(QString urlString1, QString urlString2, QString urlString3){ url1 = QUrl(urlString1); url2 = QUrl(urlString2); url3 = QUrl(urlString3); manager = new QNetworkAccessManager(this); databcoin = new QString(); bit = new FeatBit(); finished = false; bit->historylength = 0;}void Network::getReply1() { QEventLoop loop; finished = false; reply = manager->get(QNetworkRequest(url1)); connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished1())); connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); loop.exec();}void Network::downloadFinished1(){ webContent1 = reply->readAll(); finished = true;}void Network::downloadFinished2(){ webContent2 = reply->readAll(); finished = true;}void Network::downloadFinished3(){ webContent3 = reply->readAll(); finished = true;}
ui->lineEdit_4->setText(QString::number(url->reply->error()));
connect(reply, SIGNAL(QNetworkReply::error(QNetworkReply::NetworkError)), this, SLOT(errorFinded()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(errorFinded()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(errorFinded(QNetworkReply::NetworkError)));
connect(reply, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(errorFinded()));