Yet another weather forecast for OpenWeatherMap
这是一个用Qt5写的天气预报程序
weather主程序,该部分采用Qt5。weather_config配置程序,该部分代码兼容Qt4和Qt5。
git clone https://github.com/YeLee/weather.git
cd weather_config
qmake (系统默认qmake生成Makefile)
make
wget http://bulk.openweathermap.org/sample/city.list.json.gz (获取OpenWeatherMap城市列表文件)
sh newCityList.sh city.list.json.gz (SQLite3生成数据库文件)
cd weather
/usr/lib/qt5/bin/qmake (仅限Qt5版qmake)
make
把weather主程序、weather_config配置前端和weather_config.db城市列表数据库拷贝到同一目录下即可。
到OpenWeatherMap去申请一个免费的APPID。
Country国家代码(ISO 3166 Country codes)City城市对应的英文名称City Information城市信息,包含城市代码和经纬度,重复名称用下拉列表选择Language返回的天气信息语言Temperature温度格式,支持华氏、摄氏和开氏Update Frequency更新频率(单位为分),即程序间隔多长时间会从服务器获取天气信息AutoCloseWindow鼠标不在主窗口内自动关闭主窗体(单位为秒)APPIDOpenWeatherMap APPIDSubmit在程序其目录下生成weather.ini并退出(这里没有任何提示)
使用一台联网的计算机打开weather,点击托盘菜单的Show即可查看天气信息