void CardPage::downloadImg(int type, const QString &url)
{
if (url.isEmpty()) {
if (type == 0) {
// team head
ui->teamBadge->setPixmap(QPixmap("res/teamPk/enterPk_logo.png").scaled(ui->teamBadge->width(), ui->teamBadge->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
} else {
// teacher head
ui->head->setPixmap(QPixmap("res/teamPk/headImg.png").scaled(ui->head->width(), ui->head->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
}
} else {
QString filename = QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md5).toHex();
QString path = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/imgCache/" + filename + ".png";
if (QFile::exists(path)) {
if (type == 0) {
// team h
Qt 图片下载
最新推荐文章于 2024-06-22 11:14:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)