When starting the program, an error is displayed. There are no logs in the console. I do a get-request to the server and that's it. https://github.com/Radzhab/QTparser/tree/master/QTparser
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { ui->pushButton->setText("Запуск с рабочего компа"); } //////////////////////////////
#include "httphelper.h" #include <QtNetwork/QNetworkAccessManager> #include <QtNetwork/QNetworkReply> #include <QEventLoop> #include <QEvent> #include <QObject> HttpHelper::HttpHelper() { } void HttpHelper::GetHtml() { QNetworkAccessManager manager; QNetworkRequest request(QUrl("http://qt-project.org")); request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); QNetworkReply *response = manager.get(request); QEventLoop event; connect(response,SIGNAL(finished()),&event,SLOT(quit())); event.exec(); QString html = response->readAll(); // Source should be stored here }