Skip to content

Commit

Permalink
增加霾图标,API日期小改
Browse files Browse the repository at this point in the history
  • Loading branch information
sonichy committed Dec 3, 2018
1 parent 2efa529 commit 85632e4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion forcastwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static const QMap<QString, QString> weatherMap {
{"中雨", "rain1"},
{"大雨", "rain2"},
{"多云", "atmosphere"},
{"", "haze"}
};

ForcastWidget::ForcastWidget(QWidget *parent)
Expand Down Expand Up @@ -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));
Expand Down
Binary file added icon/haze.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions res.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<file>icon/snowy.png</file>
<file>icon/cloudy.png</file>
<file>cityID.txt</file>
<file>icon/haze.png</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion weatherplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]\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: [email protected]\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();
}
Expand Down

0 comments on commit 85632e4

Please sign in to comment.