适配 APM

This commit is contained in:
2026-03-22 17:28:00 +08:00
parent d36192b49c
commit 7f63ea0446
7 changed files with 616 additions and 27 deletions
+4 -1
View File
@@ -34,6 +34,8 @@ QVariant AppListModel::data(const QModelIndex &index, int role) const
return map.value("download_url"); // 返回下载 URL
case Qt::UserRole + 8: // 忽略状态
return map.value("ignored");
case Qt::UserRole + 9: // 包来源
return map.value("source");
default:
return QVariant();
}
@@ -55,9 +57,10 @@ void AppListModel::setUpdateData(const QJsonArray &updateInfo)
map["size"] = obj["size"].toString();
map["download_url"] = obj["download_url"].toString(); // 确保设置下载 URL
map["ignored"] = obj["ignored"].toBool(); // 设置忽略状态
map["source"] = obj["source"].toString(); // 设置包来源
m_data.append(map); // 添加到 QList<QVariantMap>
qDebug() << "设置到模型的包名:" << map["package"].toString() << "忽略状态:" << map["ignored"].toBool();
qDebug() << "设置到模型的包名:" << map["package"].toString() << "忽略状态:" << map["ignored"].toBool() << "来源:" << map["source"].toString();
qDebug() << "设置到模型的下载 URL:" << map["download_url"].toString(); // 检查设置的数据
}