diff --git a/forcastwidget.cpp b/forcastwidget.cpp index 9a3be91..a3cbc5b 100644 --- a/forcastwidget.cpp +++ b/forcastwidget.cpp @@ -19,6 +19,7 @@ static const QMap weatherMap { {"中雨", "rain1"}, {"大雨", "rain2"}, {"多云", "atmosphere"}, + {"霾", "haze"} }; ForcastWidget::ForcastWidget(QWidget *parent) @@ -164,7 +165,7 @@ void ForcastWidget::updateWeather() } labelTemp[i+1]->setText(wtype + " " + JA_forecast[i].toObject().value("low").toString().replace("低温","").replace("℃","").replace(" ","") + " ~ " + JA_forecast[i].toObject().value("high").toString().replace("高温","").replace(" ","")); labelTemp[i+1]->setAlignment(Qt::AlignCenter); - labelDate[i+1]->setText(JA_forecast[i].toObject().value("date").toString()); + labelDate[i+1]->setText(JA_forecast[i].toObject().value("date").toString().replace("0","") + "日 " + JA_forecast[i].toObject().value("week").toString().replace("星期","")); labelDate[i+1]->setAlignment(Qt::AlignCenter); labelWImg[i+1]->setToolTip(wtype); labelWImg[i+1]->setPixmap(pixmap.scaled(40,40)); diff --git a/icon/haze.png b/icon/haze.png new file mode 100644 index 0000000..c476e95 Binary files /dev/null and b/icon/haze.png differ diff --git a/preview.png b/preview.png index c4d0a65..5ad6462 100644 Binary files a/preview.png and b/preview.png differ diff --git a/res.qrc b/res.qrc index 806eebf..df19dcd 100644 --- a/res.qrc +++ b/res.qrc @@ -10,5 +10,6 @@ icon/snowy.png icon/cloudy.png cityID.txt + icon/haze.png diff --git a/weatherplugin.cpp b/weatherplugin.cpp index f273b40..f7d696b 100644 --- a/weatherplugin.cpp +++ b/weatherplugin.cpp @@ -164,7 +164,7 @@ void WeatherPlugin::invokedMenuItem(const QString &itemKey, const QString &menuI void WeatherPlugin::MBAbout() { - QMessageBox aboutMB(QMessageBox::NoIcon, "海天鹰天气预报 4.9", "关于\n深度Linux系统上一款在任务栏显示天气的插件。\n作者:黄颖\nE-mail: sonichy@163.com\n源码:https://github.com/sonichy/WEATHER_DDE_DOCK\n天气API:https://www.sojson.com/blog/305.html"); + QMessageBox aboutMB(QMessageBox::NoIcon, "海天鹰天气预报 4.9.1", "关于\n\n深度Linux系统上一款在任务栏显示天气的插件。\n作者:黄颖\nE-mail: sonichy@163.com\n源码:https://github.com/sonichy/WEATHER_DDE_DOCK\n天气API:https://www.sojson.com/blog/305.html"); aboutMB.setIconPixmap(QPixmap(":/icon/sunny.png")); aboutMB.exec(); }