———————HTTP请求———————
QT += core gui network
#include "qnetworkaccessmanager.h"
QNetworkAccessManager *test;
connect( test, &QNetworkAccessManager::finished ,this,&MainWindow::datadispose);
test->get(QNetworkRequest(QUrl("http://v2.alapi.cn/api/dog?token=填写自己的密钥")));
void MainWindow::datadispose(QNetworkReply *reply)
{
QString data = reply->readAll();
qDebug() << data;
ui->textEdit->setText(data);
}
———————代码获取查看下方———————