Skip to content

Commit

Permalink
测试版向正式版迁移 Qt5.10 -> Qt5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sonichy committed Nov 20, 2019
1 parent f14dc68 commit a8cc81a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions forcastwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ void ForcastWidget::updateWeather()
double lon = coord.value("lon").toDouble();
m_settings.setValue("lat", lat);
m_settings.setValue("lon", lon);
QDateTime time_sunrise = QDateTime::fromSecsSinceEpoch(JO_city.value("sunrise").toInt(), Qt::LocalTime);
QDateTime time_sunset = QDateTime::fromSecsSinceEpoch(JO_city.value("sunset").toInt(), Qt::LocalTime);
QDateTime time_sunrise = QDateTime::fromMSecsSinceEpoch(JO_city.value("sunrise").toInt()*1000L, Qt::LocalTime);
QDateTime time_sunset = QDateTime::fromMSecsSinceEpoch(JO_city.value("sunset").toInt()*1000L, Qt::LocalTime);
QJsonArray list = JD.object().value("list").toArray();
int r = 0;
for (int i=0; i<list.size(); i++) {
QDateTime date = QDateTime::fromSecsSinceEpoch(list[i].toObject().value("dt").toInt(), Qt::UTC);
QDateTime date = QDateTime::fromMSecsSinceEpoch(list[i].toObject().value("dt").toInt()*1000L, Qt::UTC);
QString sdate = date.toString("MM-dd ddd");
QString dt_txt = list[i].toObject().value("dt_txt").toString();
double temp = list[i].toObject().value("main").toObject().value("temp").toDouble() - 273.15;
Expand Down

0 comments on commit a8cc81a

Please sign in to comment.