├── UIBase ├── UIBaseWindow.cpp ├── UIBaseWindow.h ├── UIChinaCity.cpp ├── UIChinaCity.h ├── UIGlobalConfig.cpp ├── UIGlobalConfig.h ├── UIGlobalTool.cpp ├── UIGlobalTool.h ├── UIMessageBox.cpp ├── UIMessageBox.h ├── UIProgressWindow.cpp └── UIProgressWindow.h ├── WeatherApi ├── WeatherAirNow.cpp ├── WeatherAirNow.h ├── WeatherBaseInfo.cpp ├── WeatherBaseInfo.h ├── WeatherForecast.cpp ├── WeatherForecast.h ├── WeatherInterface.cpp ├── WeatherInterface.h ├── WeatherLife.cpp ├── WeatherLife.h ├── WeatherNow.cpp └── WeatherNow.h ├── WeatherSystem.pro ├── WeatherSystem.pro.user ├── WeatherUI ├── WeatherCenterWidget.cpp ├── WeatherCenterWidget.h ├── WeatherCityChangeWindow.cpp ├── WeatherCityChangeWindow.h ├── WeatherForecastItem.cpp ├── WeatherForecastItem.h ├── WeatherMainWindow.cpp └── WeatherMainWindow.h ├── app.ico ├── bin ├── Icons │ ├── AppIconD.png │ ├── Cannel.png │ ├── Close.png │ ├── Close_H.png │ ├── Config.png │ ├── Config_H.png │ ├── Confirm.png │ ├── MaxSizeDemo_H.png │ ├── MaxSizeed.png │ ├── MinButton.png │ ├── arrow-down.png │ ├── minButton_H.png │ ├── refresh.png │ ├── refreshH.png │ └── weather-icon │ │ ├── 100.png │ │ ├── 100n.png │ │ ├── 101.png │ │ ├── 102.png │ │ ├── 103.png │ │ ├── 103n.png │ │ ├── 104.png │ │ ├── 104n.png │ │ ├── 200.png │ │ ├── 201.png │ │ ├── 202.png │ │ ├── 203.png │ │ ├── 204.png │ │ ├── 205.png │ │ ├── 206.png │ │ ├── 207.png │ │ ├── 208.png │ │ ├── 209.png │ │ ├── 210.png │ │ ├── 211.png │ │ ├── 212.png │ │ ├── 213.png │ │ ├── 300.png │ │ ├── 300n.png │ │ ├── 301.png │ │ ├── 301n.png │ │ ├── 302.png │ │ ├── 303.png │ │ ├── 304.png │ │ ├── 305.png │ │ ├── 306.png │ │ ├── 307.png │ │ ├── 309.png │ │ ├── 310.png │ │ ├── 311.png │ │ ├── 312.png │ │ ├── 313.png │ │ ├── 314.png │ │ ├── 315.png │ │ ├── 316.png │ │ ├── 317.png │ │ ├── 318.png │ │ ├── 399.png │ │ ├── 400.png │ │ ├── 401.png │ │ ├── 402.png │ │ ├── 403.png │ │ ├── 404.png │ │ ├── 405.png │ │ ├── 406.png │ │ ├── 406n.png │ │ ├── 407.png │ │ ├── 407n.png │ │ ├── 408.png │ │ ├── 409.png │ │ ├── 410.png │ │ ├── 499.png │ │ ├── 500.png │ │ ├── 501.png │ │ ├── 502.png │ │ ├── 503.png │ │ ├── 504.png │ │ ├── 507.png │ │ ├── 508.png │ │ ├── 509.png │ │ ├── 510.png │ │ ├── 511.png │ │ ├── 512.png │ │ ├── 513.png │ │ ├── 514.png │ │ ├── 515.png │ │ ├── 900.png │ │ ├── 901.png │ │ ├── 999.png │ │ ├── __MACOSX │ │ ├── ._100.png │ │ ├── ._100n.png │ │ ├── ._101.png │ │ ├── ._102.png │ │ ├── ._103.png │ │ ├── ._103n.png │ │ ├── ._104.png │ │ ├── ._104n.png │ │ ├── ._200.png │ │ ├── ._201.png │ │ ├── ._202.png │ │ ├── ._203.png │ │ ├── ._204.png │ │ ├── ._205.png │ │ ├── ._206.png │ │ ├── ._207.png │ │ ├── ._208.png │ │ ├── ._209.png │ │ ├── ._210.png │ │ ├── ._211.png │ │ ├── ._212.png │ │ ├── ._213.png │ │ ├── ._300.png │ │ ├── ._300n.png │ │ ├── ._301.png │ │ ├── ._301n.png │ │ ├── ._302.png │ │ ├── ._303.png │ │ ├── ._304.png │ │ ├── ._305.png │ │ ├── ._306.png │ │ ├── ._307.png │ │ ├── ._309.png │ │ ├── ._310.png │ │ ├── ._311.png │ │ ├── ._312.png │ │ ├── ._313.png │ │ ├── ._314.png │ │ ├── ._315.png │ │ ├── ._316.png │ │ ├── ._317.png │ │ ├── ._318.png │ │ ├── ._399.png │ │ ├── ._400.png │ │ ├── ._401.png │ │ ├── ._402.png │ │ ├── ._403.png │ │ ├── ._404.png │ │ ├── ._405.png │ │ ├── ._406.png │ │ ├── ._406n.png │ │ ├── ._407.png │ │ ├── ._407n.png │ │ ├── ._408.png │ │ ├── ._409.png │ │ ├── ._410.png │ │ ├── ._499.png │ │ ├── ._500.png │ │ ├── ._501.png │ │ ├── ._502.png │ │ ├── ._503.png │ │ ├── ._504.png │ │ ├── ._507.png │ │ ├── ._508.png │ │ ├── ._509.png │ │ ├── ._510.png │ │ ├── ._511.png │ │ ├── ._512.png │ │ ├── ._513.png │ │ ├── ._514.png │ │ ├── ._515.png │ │ ├── ._900.png │ │ ├── ._901.png │ │ ├── ._999.png │ │ └── ._和风天气状况代码和图标文档.md │ │ └── 和风天气状况代码和图标文档.md ├── data │ └── LocList.xml ├── libeay32.dll ├── ssleay32.dll └── styles │ └── DarkStyle.css ├── main.cpp └── readme.md /UIBase/UIBaseWindow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "UIBaseWindow.h" 8 | #include 9 | #include 10 | #include 11 | 12 | #ifdef Q_OS_WIN 13 | #pragma comment(lib, "user32.lib") 14 | #include 15 | #include 16 | #endif 17 | 18 | UIBaseWindow::UIBaseWindow(QWidget *parent) 19 | :QWidget(parent) 20 | { 21 | this->installEventFilter(this); 22 | setWindowFlags(Qt::FramelessWindowHint); 23 | this->setMouseTracking(true); 24 | this->setProperty("NormalWidget", "NormalWidget"); 25 | 26 | m_nBorder = 2; 27 | m_TitleIconSize = 25; 28 | m_ButtonIconSize = 20; 29 | 30 | m_WindowTitle = "Douzhq Qt Demo"; 31 | m_TitleIcon = new QPixmap("./Icons/AppIconD.png"); 32 | m_MinSizeIcon = new QPixmap("./Icons/MinButton.png"); 33 | m_MinSizeHIcon = new QPixmap("./Icons/minButton_H.png"); 34 | m_MaxSizeIcon = new QPixmap("./Icons/MaxSizeed.png"); 35 | m_MaxSizeHIcon = new QPixmap("./Icons/MaxSizeDemo_H.png"); 36 | m_CloseIcon = new QPixmap("./Icons/Close.png"); 37 | m_CloseHIcon = new QPixmap("./Icons/Close_H.png"); 38 | } 39 | 40 | UIBaseWindow::~UIBaseWindow() 41 | { 42 | 43 | } 44 | 45 | void UIBaseWindow::setCustomerWindowTitle(QString titleString) 46 | { 47 | m_WindowTitle = titleString; 48 | } 49 | 50 | bool UIBaseWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) 51 | { 52 | Q_UNUSED(eventType) 53 | 54 | MSG *param = static_cast(message); 55 | 56 | switch (param->message) 57 | { 58 | case WM_NCHITTEST: 59 | { 60 | int nX = GET_X_LPARAM(param->lParam) - this->geometry().x(); 61 | int nY = GET_Y_LPARAM(param->lParam) - this->geometry().y(); 62 | 63 | // 如果鼠标位于子控件上,则不进行处理 64 | if (childAt(nX, nY) != NULL) 65 | return QWidget::nativeEvent(eventType, message, result); 66 | 67 | *result = HTCAPTION; 68 | 69 | // 鼠标区域位于窗体边框,进行缩放 70 | if ((nX > 0) && (nX < m_nBorder)) 71 | *result = HTLEFT; 72 | 73 | if ((nX > this->width() - m_nBorder) && (nX < this->width())) 74 | *result = HTRIGHT; 75 | 76 | if ((nY > 0) && (nY < m_nBorder)) 77 | *result = HTTOP; 78 | 79 | if ((nY > this->height() - m_nBorder) && (nY < this->height())) 80 | *result = HTBOTTOM; 81 | 82 | if ((nX > 0) && (nX < m_nBorder) && (nY > 0) 83 | && (nY < m_nBorder)) 84 | *result = HTTOPLEFT; 85 | 86 | if ((nX > this->width() - m_nBorder) && (nX < this->width()) 87 | && (nY > 0) && (nY < m_nBorder)) 88 | *result = HTTOPRIGHT; 89 | 90 | if ((nX > 0) && (nX < m_nBorder) 91 | && (nY > this->height() - m_nBorder) && (nY < this->height())) 92 | *result = HTBOTTOMLEFT; 93 | 94 | if ((nX > this->width() - m_nBorder) && (nX < this->width()) 95 | && (nY > this->height() - m_nBorder) && (nY < this->height())) 96 | *result = HTBOTTOMRIGHT; 97 | 98 | return true; 99 | } 100 | } 101 | 102 | return QWidget::nativeEvent(eventType, message, result); 103 | } 104 | 105 | void UIBaseWindow::paintEvent(QPaintEvent *event) 106 | { 107 | QPainter painter(this); 108 | 109 | QPen nPen; 110 | nPen.setColor(QColor(40, 40, 40)); 111 | nPen.setWidth(10); 112 | painter.setPen(nPen); 113 | painter.drawRect(0, 0, this->width(), this->height()); 114 | 115 | // 绘制标题栏 116 | painter.setBrush(QColor(40, 40, 40)); 117 | QRect nTitleRect = QRect(0, 0, this->width(), m_TitleHieght); 118 | painter.drawRect(nTitleRect); 119 | 120 | // 绘制AppIcon 121 | painter.drawPixmap(5, 5, m_TitleIconSize, m_TitleIconSize, *m_TitleIcon); 122 | 123 | // 绘制按钮 124 | if (!m_IsOnMinButton) 125 | painter.drawPixmap(this->width() - (m_TitleIconSize + 4) * 3, 5, m_TitleIconSize, m_TitleIconSize, *m_MinSizeIcon); 126 | else 127 | painter.drawPixmap(this->width() - (m_TitleIconSize + 4) * 3, 5, m_TitleIconSize, m_TitleIconSize, *m_MinSizeHIcon); 128 | 129 | if (!m_IsOnMaxButton) 130 | painter.drawPixmap(this->width() - (m_TitleIconSize + 4) * 2, 5, m_TitleIconSize, m_TitleIconSize, *m_MaxSizeIcon); 131 | else 132 | painter.drawPixmap(this->width() - (m_TitleIconSize + 4) * 2, 5, m_TitleIconSize, m_TitleIconSize, *m_MaxSizeHIcon); 133 | 134 | if (!m_IsOnCloseButton) 135 | painter.drawPixmap(this->width() - (m_TitleIconSize + 4) * 1, 5, m_TitleIconSize, m_TitleIconSize, *m_CloseIcon); 136 | else 137 | painter.drawPixmap(this->width() - (m_TitleIconSize + 4) * 1, 5, m_TitleIconSize, m_TitleIconSize, *m_CloseHIcon); 138 | 139 | // 绘制标题 140 | nPen.setColor(QColor(255, 255, 255)); 141 | painter.setPen(nPen); 142 | QTextOption o; 143 | o.setAlignment(Qt::AlignLeft | Qt::AlignVCenter); 144 | nTitleRect.setX(5 + m_TitleIconSize + 5); 145 | painter.drawText(nTitleRect, m_WindowTitle, o); 146 | 147 | 148 | return QWidget::paintEvent(event); 149 | } 150 | 151 | bool UIBaseWindow::eventFilter(QObject *obj, QEvent *event) 152 | { 153 | if (event->type() == QEvent::NonClientAreaMouseMove) 154 | disposeMouseMoveEvent(); 155 | else if (event->type() == QEvent::NonClientAreaMouseButtonPress) 156 | disposeMousePressedEvent(); 157 | else if (event->type() == QEvent::NonClientAreaMouseButtonRelease) 158 | disposeMouseReleaseEvent(); 159 | 160 | return QWidget::eventFilter(obj, event); 161 | } 162 | 163 | // 处理鼠标点击事件 164 | void UIBaseWindow::disposeMousePressedEvent(void) 165 | { 166 | QPoint nPos = cursor().pos(); 167 | nPos = this->mapFromGlobal(nPos); 168 | 169 | if (m_IsOnMinButton) 170 | minSizeWindow(); 171 | else if (m_IsOnMaxButton) 172 | maxSizeWindow(); 173 | else if (m_IsOnCloseButton) 174 | closeWindow(); 175 | 176 | disposeMouseReleaseEvent(); 177 | } 178 | 179 | void UIBaseWindow::minSizeWindow(void) 180 | { 181 | this->showMinimized(); 182 | } 183 | 184 | void UIBaseWindow::maxSizeWindow(void) 185 | { 186 | if (this->isMaximized()) 187 | this->showNormal(); 188 | else 189 | this->showMaximized(); 190 | } 191 | 192 | void UIBaseWindow::closeWindow(void) 193 | { 194 | this->close(); 195 | } 196 | 197 | // 处理鼠标移动事件 198 | void UIBaseWindow::disposeMouseMoveEvent(void) 199 | { 200 | QPoint nMousePos = cursor().pos(); 201 | nMousePos = this->mapFromGlobal(nMousePos); 202 | 203 | m_IsOnMinButton = false; 204 | m_IsOnMaxButton = false; 205 | m_IsOnCloseButton = false; 206 | 207 | QRect nMinSizeButtonRect = QRect(this->width() - (m_TitleIconSize + 4) * 3, 5, \ 208 | m_TitleIconSize, m_TitleIconSize); 209 | QRect nMaxSizeButtonRect = QRect(this->width() - (m_TitleIconSize + 4) * 2, 5, \ 210 | m_TitleIconSize, m_TitleIconSize); 211 | QRect nCloseButtonRect = QRect(this->width() - (m_TitleIconSize + 4) * 1, 5, \ 212 | m_TitleIconSize, m_TitleIconSize); 213 | 214 | if (nMinSizeButtonRect.contains(nMousePos)) 215 | m_IsOnMinButton = true; 216 | else if (nMaxSizeButtonRect.contains(nMousePos)) 217 | m_IsOnMaxButton = true; 218 | else if (nCloseButtonRect.contains(nMousePos)) 219 | m_IsOnCloseButton = true; 220 | 221 | this->repaint(); 222 | } 223 | 224 | void UIBaseWindow::disposeMouseReleaseEvent(void) 225 | { 226 | m_IsOnMinButton = false; 227 | m_IsOnMaxButton = false; 228 | m_IsOnCloseButton = false; 229 | this->repaint(); 230 | } 231 | -------------------------------------------------------------------------------- /UIBase/UIBaseWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef UIBASE_WINDOW_H 2 | #define UIBASE_WINDOW_H 3 | 4 | #include 5 | 6 | class UIBaseWindow : public QWidget 7 | { 8 | public: 9 | UIBaseWindow(QWidget *parent = nullptr); 10 | ~UIBaseWindow(); 11 | 12 | // 设置标题 13 | void setCustomerWindowTitle(QString titleString); 14 | 15 | protected: 16 | void paintEvent(QPaintEvent *event) override; 17 | bool eventFilter(QObject *obj, QEvent *event) override; 18 | virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; 19 | 20 | private: 21 | int m_nBorder; 22 | int m_TitleIconSize; 23 | int m_ButtonIconSize; 24 | 25 | QPixmap *m_TitleIcon = nullptr; 26 | QPixmap *m_MinSizeIcon = nullptr; 27 | QPixmap *m_MinSizeHIcon = nullptr; 28 | QPixmap *m_MaxSizeIcon = nullptr; 29 | QPixmap *m_MaxSizeHIcon = nullptr; 30 | QPixmap *m_CloseIcon = nullptr; 31 | QPixmap *m_CloseHIcon = nullptr; 32 | 33 | QString m_WindowTitle; 34 | int m_TitleHieght = 30; 35 | 36 | bool m_IsOnMinButton = false; 37 | bool m_IsOnMaxButton = false; 38 | bool m_IsOnCloseButton = false; 39 | bool m_IsOnConfigButton = false; 40 | 41 | // 处理鼠标点击事件 42 | void disposeMousePressedEvent(void); 43 | // 处理鼠标移动事件 44 | void disposeMouseMoveEvent(void); 45 | // 处理鼠标点击释放事件 46 | void disposeMouseReleaseEvent(void); 47 | 48 | // 最小化窗口 49 | void minSizeWindow(void); 50 | // 最大化窗口 51 | void maxSizeWindow(void); 52 | // 关闭窗口 53 | void closeWindow(void); 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /UIBase/UIChinaCity.cpp: -------------------------------------------------------------------------------- 1 | #include "UIChinaCity.h" 2 | #include 3 | #include 4 | #include 5 | 6 | UIChinaCity::UIChinaCity(QObject *parent) 7 | :QObject(parent) 8 | { 9 | disposeCityList(); 10 | } 11 | 12 | UIChinaCity::~UIChinaCity() 13 | { 14 | 15 | } 16 | 17 | void UIChinaCity::disposeCityList(void) 18 | { 19 | QFile file("./data/LocList.xml"); 20 | if (!file.open(QFile::ReadOnly)) 21 | return; 22 | 23 | QDomDocument doc; 24 | if (!doc.setContent(&file)) 25 | { 26 | file.close(); 27 | return; 28 | } 29 | file.close(); 30 | 31 | QDomElement rootElement = doc.documentElement(); 32 | if (rootElement.tagName() != "Location") 33 | return; 34 | 35 | QDomElement chinaElement; 36 | QDomNodeList nodeLsit = rootElement.childNodes(); 37 | for (int i=0; i cityInfoList; 57 | cityInfoList.clear(); 58 | 59 | // 解析城市 60 | QDomNodeList cityNodeList = element.childNodes(); 61 | for (int j=0; j regionNameList; 69 | regionNameList.clear(); 70 | 71 | // 解析区 72 | QDomNodeList regionNodeList = cityElement.childNodes(); 73 | for (int k=0; k UIChinaCity::getProvinceName(void) 90 | { 91 | QList provinceNameList; 92 | provinceNameList.clear(); 93 | for (auto itor = m_ChinaCityInfo.begin(); itor != m_ChinaCityInfo.end(); ++itor) 94 | { 95 | provinceNameList.push_back(itor.key()); 96 | } 97 | return provinceNameList; 98 | } 99 | 100 | QList UIChinaCity::getCitysName(QString name) 101 | { 102 | auto itor = m_ChinaCityInfo.find(name); 103 | QList cityList = itor.value(); 104 | QList cityNameList; 105 | cityNameList.clear(); 106 | for (int i=0; i UIChinaCity::getRegionsName(QString stateName, QString cityName) 115 | { 116 | auto itor = m_ChinaCityInfo.find(stateName); 117 | QList cityList = itor.value(); 118 | QList regionNameList; 119 | regionNameList.clear(); 120 | for (int i=0; i 5 | #include 6 | class UIChinaCity : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | UIChinaCity(QObject *parent = nullptr); 12 | ~UIChinaCity(); 13 | 14 | struct CityInfo 15 | { 16 | QString cityName; // 城市名字 17 | QList regionName; // 城市下的区的名字 18 | }; 19 | 20 | // 获取所有的省份 21 | QList getProvinceName(void); 22 | // 获取某个省下的所有的城市 23 | QList getCitysName(QString); 24 | // 获取某个省下的某个市下的所有的县 25 | QList getRegionsName(QString, QString); 26 | 27 | private: 28 | // 解析城市列表 29 | void disposeCityList(void); 30 | 31 | QMap> m_ChinaCityInfo; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /UIBase/UIGlobalConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "UIGlobalConfig.h" 2 | #include 3 | #include 4 | 5 | UIGlobalConfig::UIGlobalConfig(QObject *parent) 6 | :QObject(parent) 7 | { 8 | m_showScreenShortHide = false; 9 | m_FrameSpeed = 10; 10 | m_ScreenShortGifPath = "Test.gif"; 11 | m_OtherFileGifPath = "CreateGif.gif"; 12 | 13 | loadConfigFile(); 14 | } 15 | 16 | UIGlobalConfig::~UIGlobalConfig() 17 | { 18 | 19 | } 20 | 21 | UIGlobalConfig *UIGlobalConfig::getInstance(void) 22 | { 23 | static UIGlobalConfig instance; 24 | return &instance; 25 | } 26 | 27 | void UIGlobalConfig::loadConfigFile(void) 28 | { 29 | QString configFile = "./config/GlobalConfig.ini"; 30 | 31 | QSettings settings(configFile, QSettings::IniFormat); 32 | m_showScreenShortHide = settings.value("GlobalConfig/ScreenShortHide").toBool(); 33 | m_FrameSpeed = settings.value("GlobalConfig/FreamSpeed").toInt(); 34 | m_ScreenShortGifPath = settings.value("GlobalConfig/ScreenShortGifCreate").toString(); 35 | m_OtherFileGifPath = settings.value("GlobalConfig/OtherFileGifCreate").toString(); 36 | } 37 | 38 | void UIGlobalConfig::syncConfigFile(void) 39 | { 40 | QString configFile = "./config/GlobalConfig.ini"; 41 | 42 | QSettings settings(configFile, QSettings::IniFormat); 43 | settings.setValue("GlobalConfig/ScreenShortHide", m_showScreenShortHide); 44 | settings.setValue("GlobalConfig/FreamSpeed", m_FrameSpeed); 45 | settings.setValue("GlobalConfig/ScreenShortGifCreate", m_ScreenShortGifPath); 46 | settings.setValue("GlobalConfig/OtherFileGifCreate", m_OtherFileGifPath); 47 | } 48 | 49 | bool UIGlobalConfig::getScreenShortMainWidgetShow(void) 50 | { 51 | return m_showScreenShortHide; 52 | } 53 | 54 | void UIGlobalConfig::setScreenShortMainWidgetShow(bool isShow) 55 | { 56 | m_showScreenShortHide = isShow; 57 | syncConfigFile(); 58 | } 59 | 60 | int UIGlobalConfig::getScreenShortFrameSpeed(void) 61 | { 62 | return m_FrameSpeed; 63 | } 64 | 65 | void UIGlobalConfig::setScreenShortFrameSpeed(int speed) 66 | { 67 | m_FrameSpeed = speed; 68 | syncConfigFile(); 69 | } 70 | 71 | QString UIGlobalConfig::getScreenShortGifPath(void) 72 | { 73 | return m_ScreenShortGifPath; 74 | } 75 | 76 | void UIGlobalConfig::setScreenShortGifPath(QString path) 77 | { 78 | m_ScreenShortGifPath = path; 79 | syncConfigFile(); 80 | } 81 | 82 | QString UIGlobalConfig::getOtherFileGifPath(void) 83 | { 84 | return m_OtherFileGifPath; 85 | } 86 | 87 | void UIGlobalConfig::setOtherFileGifPath(QString path) 88 | { 89 | m_OtherFileGifPath = path; 90 | syncConfigFile(); 91 | } 92 | -------------------------------------------------------------------------------- /UIBase/UIGlobalConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef UIGLOBAL_CONFIG_H 2 | #define UIGLOBAL_CONFIG_H 3 | 4 | #include 5 | 6 | #define g_UIGlobalConfig UIGlobalConfig::getInstance() 7 | 8 | class UIGlobalConfig : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | private: 13 | UIGlobalConfig(QObject *parent = nullptr); 14 | ~UIGlobalConfig(); 15 | 16 | public: 17 | static UIGlobalConfig *getInstance(void); 18 | 19 | // 加载XML文件 20 | void loadConfigFile(void); 21 | // 同步配置到配置文件 22 | void syncConfigFile(void); 23 | // 获取截图时是够显示主窗口 24 | bool getScreenShortMainWidgetShow(void); 25 | // 设置截图时是够显示主窗口 26 | void setScreenShortMainWidgetShow(bool); 27 | // 获取动画帧率速度 28 | int getScreenShortFrameSpeed(void); 29 | // 设置动画帧率速度 30 | void setScreenShortFrameSpeed(int); 31 | // 获取截屏gif文件路径 32 | QString getScreenShortGifPath(void); 33 | // 设置截屏gif文件路径 34 | void setScreenShortGifPath(QString); 35 | // 获取多文件合成gif文件路径 36 | QString getOtherFileGifPath(void); 37 | // 设置多文件合成gif文件路径 38 | void setOtherFileGifPath(QString); 39 | 40 | private: 41 | bool m_showScreenShortHide; 42 | int m_FrameSpeed; 43 | QString m_ScreenShortGifPath; 44 | QString m_OtherFileGifPath; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /UIBase/UIGlobalTool.cpp: -------------------------------------------------------------------------------- 1 | #include "UIGlobalTool.h" 2 | #include 3 | 4 | UIGlobalTool::UIGlobalTool(QObject *parent) 5 | :QObject(parent) 6 | { 7 | 8 | } 9 | 10 | UIGlobalTool::~UIGlobalTool() 11 | { 12 | 13 | } 14 | 15 | UIGlobalTool *UIGlobalTool::getInstance(void) 16 | { 17 | static UIGlobalTool instance; 18 | return &instance; 19 | } 20 | 21 | void UIGlobalTool::addShadowEffect(QWidget *shadowWdt) 22 | { 23 | QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect; 24 | shadowEffect->setOffset(1, 1); 25 | shadowEffect->setColor(QColor(40, 40, 40)); 26 | shadowEffect->setBlurRadius(2); 27 | shadowWdt->setGraphicsEffect(shadowEffect); 28 | } 29 | -------------------------------------------------------------------------------- /UIBase/UIGlobalTool.h: -------------------------------------------------------------------------------- 1 | #ifndef UIGLOBALTOOL_H 2 | #define UIGLOBALTOOL_H 3 | 4 | #include 5 | #include 6 | #define g_GlobalTool UIGlobalTool::getInstance() 7 | 8 | class UIGlobalTool : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | private: 13 | UIGlobalTool(QObject *parent = nullptr); 14 | ~UIGlobalTool(); 15 | 16 | public: 17 | static UIGlobalTool *getInstance(void); 18 | 19 | // 添加阴影 20 | void addShadowEffect(QWidget *shadowWdt); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /UIBase/UIMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include "UIMessageBox.h" 2 | #include 3 | 4 | UIMessageBox::UIMessageBox(QWidget *parent) 5 | :UIBaseWindow(parent) 6 | { 7 | QVBoxLayout *mainLayout = new QVBoxLayout(this); 8 | 9 | m_TagLabel = new QLabel(); 10 | mainLayout->addSpacing(30); 11 | mainLayout->addWidget(m_TagLabel); 12 | QPushButton *confirmButton = new QPushButton("确定"); 13 | mainLayout->addWidget(confirmButton, 0, Qt::AlignRight); 14 | 15 | QObject::connect(confirmButton, &QPushButton::clicked, [=](void)->void{ 16 | this->close(); 17 | }); 18 | } 19 | 20 | UIMessageBox::~UIMessageBox() 21 | { 22 | 23 | } 24 | 25 | void UIMessageBox::setTagText(QString tagText) 26 | { 27 | m_TagLabel->setText(tagText); 28 | } 29 | 30 | void UIMessageBox::abort(QString title, QString message) 31 | { 32 | static UIMessageBox messageBox; 33 | messageBox.setWindowFlags(messageBox.windowFlags() | Qt::WindowStaysOnTopHint); 34 | messageBox.setCustomerWindowTitle(title); 35 | messageBox.setTagText(message); 36 | messageBox.resize(300, 150); 37 | messageBox.show(); 38 | } 39 | -------------------------------------------------------------------------------- /UIBase/UIMessageBox.h: -------------------------------------------------------------------------------- 1 | #ifndef UIMESSAGEBOX_H 2 | #define UIMESSAGEBOX_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "UIBaseWindow.h" 8 | 9 | class UIMessageBox : public UIBaseWindow 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | UIMessageBox(QWidget *parent = nullptr); 15 | ~UIMessageBox(); 16 | 17 | private: 18 | QLabel *m_TagLabel = nullptr; 19 | 20 | public: 21 | void abort(QString title, QString message); 22 | // 设置文本 23 | void setTagText(QString); 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /UIBase/UIProgressWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "UIProgressWindow.h" 2 | #include 3 | 4 | UIProgressWindow::UIProgressWindow(QWidget *parent) 5 | :UIBaseWindow(parent) 6 | { 7 | m_TagLabelText = new QLabel; 8 | m_ProgressBar = new QProgressBar; 9 | m_ProgressBar->setValue(0); 10 | m_ProgressBar->setRange(0, 100); 11 | 12 | QVBoxLayout *mainLayout = new QVBoxLayout(this); 13 | mainLayout->addSpacing(30); 14 | mainLayout->addWidget(m_ProgressBar); 15 | mainLayout->addWidget(m_TagLabelText, 0, Qt::AlignLeft); 16 | } 17 | 18 | UIProgressWindow::~UIProgressWindow() 19 | { 20 | 21 | } 22 | 23 | // 设置显示内容 24 | void UIProgressWindow::setTagContent(QString str) 25 | { 26 | m_TagLabelText->setText(str); 27 | } 28 | 29 | // 设置当前的显示状态 30 | void UIProgressWindow::setProgressValue(int value) 31 | { 32 | m_ProgressBar->setValue(value); 33 | } 34 | -------------------------------------------------------------------------------- /UIBase/UIProgressWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef UIPROGRESS_WINDOW_H 2 | #define UIPROGRESS_WINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "UIBaseWindow.h" 10 | 11 | class UIProgressWindow : public UIBaseWindow 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | UIProgressWindow(QWidget *parent = nullptr); 17 | ~UIProgressWindow(); 18 | 19 | // 设置显示内容 20 | void setTagContent(QString str); 21 | // 设置当前的显示状态 22 | void setProgressValue(int); 23 | 24 | private: 25 | QLabel *m_TagLabelText = nullptr; 26 | QProgressBar *m_ProgressBar = nullptr; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /WeatherApi/WeatherAirNow.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherAirNow.h" 2 | 3 | WeatherAirNow::WeatherAirNow() 4 | { 5 | 6 | } 7 | 8 | WeatherAirNow::~WeatherAirNow() 9 | { 10 | 11 | } 12 | 13 | void WeatherAirNow::disposeWeatherInfo(QJsonObject &jsonObject) 14 | { 15 | if (jsonObject.contains("air_now_city")) 16 | { 17 | QJsonObject airQuality = jsonObject.value("air_now_city").toObject(); 18 | 19 | m_AirQualityCity.aqi = airQuality.value("aqi").toString().toInt(); // 空气质量指数,AQI和PM25的关系 74 20 | m_AirQualityCity.main = airQuality.value("main").toString(); // 主要污染物 pm25 21 | m_AirQualityCity.qlty = airQuality.value("qlty").toString(); // 空气质量,取值范围:优,良,轻度污染,中度污染,重度污染,严重污染,查看计算方式 良 22 | m_AirQualityCity.pm10 = airQuality.value("pm10").toString().toInt(); // pm10 78 23 | m_AirQualityCity.pm25 = airQuality.value("pm25").toString().toInt(); // pm25 66 24 | m_AirQualityCity.no2 = airQuality.value("no2").toString().toFloat(); // 二氧化氮 40 25 | m_AirQualityCity.so2 = airQuality.value("so2").toString().toFloat(); // 二氧化硫 30 26 | m_AirQualityCity.co = airQuality.value("co").toString().toFloat(); // 一氧化碳 33 27 | m_AirQualityCity.o3 = airQuality.value("o3").toString().toFloat(); // 臭氧 20 28 | } 29 | } 30 | 31 | WeatherAirNow::AirQualityCity WeatherAirNow::getAirQualityCity(void) 32 | { 33 | return m_AirQualityCity; 34 | } 35 | -------------------------------------------------------------------------------- /WeatherApi/WeatherAirNow.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_AIRNOW_H 2 | #define WEATHER_AIRNOW_H 3 | 4 | #include "WeatherBaseInfo.h" 5 | #include 6 | 7 | class WeatherAirNow : public WeatherBaseInfo 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | struct AirQualityCity 13 | { 14 | int aqi; // 空气质量指数,AQI和PM25的关系 74 15 | QString main; // 主要污染物 pm25 16 | QString qlty; // 空气质量,取值范围:优,良,轻度污染,中度污染,重度污染,严重污染,查看计算方式 良 17 | int pm10; // pm10 78 18 | int pm25; // pm25 66 19 | float no2; // 二氧化氮 40 20 | float so2; // 二氧化硫 30 21 | float co; // 一氧化碳 33 22 | float o3; // 臭氧 20 23 | }; 24 | public: 25 | WeatherAirNow(); 26 | ~WeatherAirNow(); 27 | 28 | // 处理空气质量的数据 29 | void disposeWeatherInfo(QJsonObject &jsonObject) override; 30 | // 获取空气质量 31 | AirQualityCity getAirQualityCity(void); 32 | 33 | private: 34 | AirQualityCity m_AirQualityCity; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /WeatherApi/WeatherBaseInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherBaseInfo.h" 2 | 3 | WeatherBaseInfo::WeatherBaseInfo(QObject *parent) 4 | :QObject(parent) 5 | { 6 | 7 | } 8 | 9 | WeatherBaseInfo::~WeatherBaseInfo() 10 | { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /WeatherApi/WeatherBaseInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_BASE_INFO_H 2 | #define WEATHER_BASE_INFO_H 3 | 4 | #include 5 | #include 6 | class WeatherBaseInfo : public QObject 7 | { 8 | public: 9 | WeatherBaseInfo(QObject *parent = nullptr); 10 | ~WeatherBaseInfo(); 11 | 12 | public: 13 | virtual void disposeWeatherInfo(QJsonObject &jsonObject) = 0; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /WeatherApi/WeatherForecast.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherForecast.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | WeatherForecast::WeatherForecast() 8 | { 9 | m_DailyForecastList.clear(); 10 | } 11 | 12 | WeatherForecast::~WeatherForecast() 13 | { 14 | 15 | } 16 | 17 | QList WeatherForecast::getDailyForecast(void) 18 | { 19 | return m_DailyForecastList; 20 | } 21 | 22 | void WeatherForecast::disposeWeatherInfo(QJsonObject &jsonObjects) 23 | { 24 | // 解析天气预报 25 | if (jsonObjects.contains("daily_forecast")) 26 | { 27 | if (!jsonObjects.value("daily_forecast").isArray()) 28 | return; 29 | 30 | m_DailyForecastList.clear(); 31 | QJsonArray jsonArray = jsonObjects.value("daily_forecast").toArray(); 32 | for (int i=0; i 5 | #include 6 | 7 | class WeatherForecast : public WeatherBaseInfo 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | struct DailyForecast 13 | { 14 | QDate date; // 预报日期 2013-12-30 15 | QTime sr; // 日出时间 07:36 16 | QTime ss; // 日落时间 16:58 17 | QTime mr; // 月升时间 04:47 18 | QTime ms; // 月落时间 14:59 19 | int tmp_max; // 最高温度 4 20 | int tmp_min; // 最低温度 -5 21 | int cond_code_d; // 白天天气状况代码 100 22 | int cond_code_n; // 晚间天气状况代码 100 23 | QString cond_txt_d; // 白天天气状况描述 晴 24 | QString cond_txt_n; // 晚间天气状况描述 晴 25 | int wind_deg; // 风向360角度 310 26 | QString wind_dir; // 风向 西北风 27 | QString wind_sc; // 风力 1-2 28 | int wind_spd; // 风速,公里/小时 14 29 | int hum; // 相对湿度 37 30 | int pcpn; // 降水量 0 31 | int pop; // 降水概率 0 32 | int pres; // 大气压强 1018 33 | int uv_index; // 紫外线强度指数 3 34 | int vis; // 能见度,单位:公里 10 35 | }; 36 | 37 | public: 38 | WeatherForecast(); 39 | ~WeatherForecast(); 40 | 41 | // 获取三天的天气数据 42 | QList getDailyForecast(void); 43 | 44 | // 处理预报的数据 45 | void disposeWeatherInfo(QJsonObject &jsonObject) override; 46 | 47 | private: 48 | QList m_DailyForecastList; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /WeatherApi/WeatherInterface.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherInterface.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | WeatherInterface::WeatherInterface(QObject *parent) 11 | :QObject(parent) 12 | { 13 | m_PrivateKey = "898b4f748e104ca09cbd161125421a86"; 14 | m_Manager = new QNetworkAccessManager(this); 15 | m_TypeInterfaceMap.clear(); 16 | 17 | // 初始化数据 18 | initData(); 19 | } 20 | 21 | WeatherInterface::~WeatherInterface() 22 | { 23 | 24 | } 25 | 26 | WeatherInterface *WeatherInterface::getInstance(void) 27 | { 28 | static WeatherInterface instance; 29 | return &instance; 30 | } 31 | 32 | void WeatherInterface::initData(void) 33 | { 34 | m_WeatherGetType = Weather_Forecast_Type; 35 | //m_LocationCity = "auto_ip"; 36 | m_LocationCity = "昌平"; 37 | m_AirQualityCity = "北京"; 38 | 39 | m_TypeInterfaceMap.insert(Weather_Forecast_Type, new WeatherForecast); 40 | m_TypeInterfaceMap.insert(Weather_Now_Type, new WeatherNow); 41 | m_TypeInterfaceMap.insert(Weather_LifeStyle_Type, new WeatherLife); 42 | m_TypeInterfaceMap.insert(Weather_AirQuality_Type, new WeatherAirNow); 43 | } 44 | 45 | QString WeatherInterface::getURLAttrStringByType(WeatherGetType type) 46 | { 47 | if (type == Weather_Forecast_Type) 48 | return "weather/forecast"; 49 | else if (type == Weather_Now_Type) 50 | return "weather/now"; 51 | else if (type == Weather_LifeStyle_Type) 52 | return "weather/lifestyle"; 53 | else if (type == Weather_AirQuality_Type) 54 | return "air/now"; 55 | 56 | return ""; 57 | } 58 | 59 | void WeatherInterface::disposeWeatherJsonData(QString jsonData) 60 | { 61 | QJsonParseError jsonError; 62 | QByteArray byteArray = jsonData.toUtf8(); 63 | QJsonDocument doucment = QJsonDocument::fromJson(byteArray, &jsonError); // 转化为 JSON 文档 64 | if (doucment.isNull() || jsonError.error != QJsonParseError::NoError) 65 | return; 66 | 67 | // 获取JsonObject 68 | QJsonArray mainDataJsonArray; 69 | if (doucment.isObject()) 70 | { 71 | QJsonObject jsonObject = doucment.object(); 72 | if (jsonObject.contains("HeWeather6")) 73 | { 74 | QJsonValue jsonValue = jsonObject.value("HeWeather6"); 75 | if (jsonValue.isArray()) 76 | mainDataJsonArray = jsonValue.toArray(); 77 | else 78 | return; 79 | } 80 | } 81 | 82 | QJsonObject mainDataJsonObject = mainDataJsonArray.at(0).toObject(); 83 | 84 | // 解释Basic 85 | if (mainDataJsonObject.contains("basic")) 86 | { 87 | QJsonObject basicJsonObject = mainDataJsonObject.value("basic").toObject(); 88 | m_WeatherBaseData.cid = basicJsonObject.value("cid").toString(); 89 | m_WeatherBaseData.location = basicJsonObject.value("location").toString(); 90 | m_WeatherBaseData.parent_city = basicJsonObject.value("parent_city").toString(); 91 | m_WeatherBaseData.admin_area = basicJsonObject.value("admin_area").toString(); 92 | m_WeatherBaseData.cnty = basicJsonObject.value("cnty").toString(); 93 | m_WeatherBaseData.lat = basicJsonObject.value("lat").toString().toDouble(); 94 | m_WeatherBaseData.lon = basicJsonObject.value("lon").toString().toDouble(); 95 | m_WeatherBaseData.tz = basicJsonObject.value("tz").toString().toDouble(); 96 | } 97 | 98 | // 解析更新时间 99 | if (mainDataJsonObject.contains("update")) 100 | { 101 | QJsonObject updateJsonObject = mainDataJsonObject.value("update").toObject(); 102 | m_WeatherTime.localTime = QDateTime::fromString(updateJsonObject.value("loc").toString(), "yyyy-MM-dd hh:mm"); 103 | m_WeatherTime.utcTime = QDateTime::fromString(updateJsonObject.value("utc").toString(), "yyyy-MM-dd hh:mm"); 104 | } 105 | 106 | // 解析状态码 107 | if (mainDataJsonObject.contains("status")) 108 | { 109 | m_WeatherStatus.statusCode = mainDataJsonObject.value("status").toString(); 110 | m_WeatherStatus.note = getStatusCodeNote(m_WeatherStatus.statusCode); 111 | } 112 | 113 | // 解析类型的信息 114 | m_TypeInterfaceMap[m_WeatherGetType]->disposeWeatherInfo(mainDataJsonObject); 115 | } 116 | 117 | QString WeatherInterface::getStatusCodeNote(QString statusCode) 118 | { 119 | if ("ok" == statusCode) 120 | return "数据正常"; 121 | else if ("invalid key" == statusCode) 122 | return "错误的key,请检查你的key是否输入以及是否输入有误"; 123 | else if ("unknown location" == statusCode) 124 | return "未知或错误城市/地区"; 125 | else if ("no data for this location" == statusCode) 126 | return "该城市/地区没有你所请求的数据"; 127 | else if ("no more requests" == statusCode) 128 | return "超过访问次数"; 129 | else if ("param invalid" == statusCode) 130 | return "参数错误,请检查你传递的参数是否正确"; 131 | else if ("too fast" == statusCode) 132 | return "超过限定的QPM"; 133 | else if ("dead" == statusCode) 134 | return "无响应或超时"; 135 | else if ("permission denied" == statusCode) 136 | return "无访问权限,你没有购买你所访问的这部分服务"; 137 | else if ("sign error" == statusCode) 138 | return "签名错误"; 139 | } 140 | 141 | void WeatherInterface::setConfigNetWorkProxy(bool visible) 142 | { 143 | m_IsConfigNetWorkProxy = visible; 144 | 145 | if (m_IsConfigNetWorkProxy) 146 | { 147 | QNetworkProxy proxy; 148 | proxy.setType(QNetworkProxy::HttpProxy); 149 | proxy.setHostName("127.0.0.1"); 150 | proxy.setPort(8888); 151 | m_Manager->setProxy(proxy); 152 | } 153 | else 154 | m_Manager->setProxy(QNetworkProxy::NoProxy); 155 | } 156 | 157 | void WeatherInterface::updateData(void) 158 | { 159 | QString jsonData = getReplayData(); 160 | disposeWeatherJsonData(jsonData); 161 | } 162 | 163 | void WeatherInterface::setCurrentWeatherInfoType(WeatherGetType type) 164 | { 165 | m_WeatherGetType = type; 166 | } 167 | 168 | void WeatherInterface::setCurrentCityName(QString cityName) 169 | { 170 | m_LocationCity = cityName; 171 | } 172 | 173 | void WeatherInterface::setAirQualityCityName(QString cityName) 174 | { 175 | m_AirQualityCity = cityName; 176 | } 177 | 178 | QString WeatherInterface::getCurrentCityName(void) 179 | { 180 | return m_LocationCity; 181 | } 182 | 183 | // 获取天气的基础信息 184 | WeatherInterface::WeatherBaseData WeatherInterface::getBaseData(void) 185 | { 186 | return m_WeatherBaseData; 187 | } 188 | 189 | // 获取更新时间信息 190 | WeatherInterface::WeatherUpdateTime WeatherInterface::getUpdateTime(void) 191 | { 192 | return m_WeatherTime; 193 | } 194 | 195 | QList WeatherInterface::getDailyForecast(void) 196 | { 197 | WeatherForecast *pWeatherForecast = dynamic_cast(m_TypeInterfaceMap[Weather_Forecast_Type]); 198 | if (pWeatherForecast) 199 | return pWeatherForecast->getDailyForecast(); 200 | } 201 | 202 | WeatherNow::WeatherNowInfo WeatherInterface::getNowWeatherInfo(void) 203 | { 204 | WeatherNow *pWeatherNow = dynamic_cast(m_TypeInterfaceMap[Weather_Now_Type]); 205 | if (pWeatherNow) 206 | return pWeatherNow->getNowWeatherInfo(); 207 | } 208 | 209 | QList WeatherInterface::getLifeStyleInfoList(void) 210 | { 211 | WeatherLife *pWeatherLifeStyle = dynamic_cast(m_TypeInterfaceMap[Weather_LifeStyle_Type]); 212 | if (pWeatherLifeStyle) 213 | return pWeatherLifeStyle->getLifeStyleInfoList(); 214 | } 215 | 216 | WeatherAirNow::AirQualityCity WeatherInterface::getAirQualityCity(void) 217 | { 218 | WeatherAirNow *pWeatherAirNow = dynamic_cast(m_TypeInterfaceMap[Weather_AirQuality_Type]); 219 | if (pWeatherAirNow) 220 | return pWeatherAirNow->getAirQualityCity(); 221 | } 222 | 223 | QColor WeatherInterface::getAirQualityCityColor(void) 224 | { 225 | QColor color = QColor(255, 255, 255); 226 | WeatherAirNow *pWeatherAirNow = dynamic_cast(m_TypeInterfaceMap[Weather_AirQuality_Type]); 227 | if (pWeatherAirNow) 228 | { 229 | int nAqi = pWeatherAirNow->getAirQualityCity().aqi; 230 | if (nAqi <= 100) 231 | color = QColor(0, 255, 0); 232 | else if (nAqi <= 200) 233 | color = QColor(230, 230, 0); 234 | else 235 | color = QColor(255, 0, 0); 236 | } 237 | 238 | return color; 239 | } 240 | 241 | void WeatherInterface::updateWeatherInfo(void) 242 | { 243 | // 天气预报 244 | setCurrentWeatherInfoType(Weather_Forecast_Type); 245 | updateData(); 246 | // 实时天气 247 | setCurrentWeatherInfoType(Weather_Now_Type); 248 | updateData(); 249 | // 生活指数 250 | setCurrentWeatherInfoType(Weather_LifeStyle_Type); 251 | updateData(); 252 | // 空气质量 253 | setCurrentWeatherInfoType(Weather_AirQuality_Type); 254 | updateData(); 255 | } 256 | 257 | QString WeatherInterface::getWeatherIcon(int code) 258 | { 259 | QString weatherIconString = "./Icons/weather-icon/%1.png"; 260 | weatherIconString = weatherIconString.arg(code); 261 | return weatherIconString; 262 | } 263 | 264 | QString WeatherInterface::getReplayData(QString attrValue, QMap map) 265 | { 266 | if (map.count() <= 0) 267 | return ""; 268 | 269 | QString baseUrlString = WEATHER_INTERFACE_BASEURL; 270 | baseUrlString += attrValue; 271 | 272 | // 设置URL 273 | QUrl url(baseUrlString); 274 | QUrlQuery query; 275 | query.addQueryItem("key", m_PrivateKey); 276 | for (auto itor = map.begin(); itor != map.end(); ++itor) 277 | { 278 | QString key = itor.key(); 279 | QString value = itor.value(); 280 | 281 | query.addQueryItem(key, value); 282 | } 283 | url.setQuery(query); 284 | qDebug() <get(requset); 292 | 293 | // 等待请求完成 294 | QEventLoop loop; 295 | QObject::connect(m_Manager, &QNetworkAccessManager::finished, &loop, &QEventLoop::quit); 296 | loop.exec(); 297 | 298 | QString replyString = QString(pReplay->readAll().data()); 299 | return replyString; 300 | } 301 | 302 | QString WeatherInterface::getReplayData(void) 303 | { 304 | QString attrValue = getURLAttrStringByType(m_WeatherGetType); 305 | 306 | QMap map; 307 | map.clear(); 308 | if (Weather_AirQuality_Type != m_WeatherGetType) 309 | map.insert("location", m_LocationCity); 310 | else 311 | map.insert("location", m_AirQualityCity); 312 | 313 | return getReplayData(attrValue, map); 314 | } 315 | -------------------------------------------------------------------------------- /WeatherApi/WeatherInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_INTERFACE_H 2 | #define WEATHER_INTERFACE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "WeatherBaseInfo.h" 10 | #include "WeatherForecast.h" 11 | #include "WeatherNow.h" 12 | #include "WeatherLife.h" 13 | #include "WeatherAirNow.h" 14 | 15 | #define WEATHER_INTERFACE_BASEURL "https://free-api.heweather.com/s6/" 16 | #define g_WeatherInterface WeatherInterface::getInstance() 17 | 18 | class WeatherInterface : public QObject 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | enum WeatherGetType 24 | { 25 | Weather_Forecast_Type, // 天气预报 26 | Weather_Now_Type, // 实时天气 27 | Weather_LifeStyle_Type, // 生活指数 28 | Weather_AirQuality_Type // 空气质量 29 | }; 30 | 31 | public: 32 | // 基础信息 33 | struct WeatherBaseData 34 | { 35 | QString location; // 地区/城市名称 (海淀) 36 | QString cid; // 地区/城市ID (CN101080402) 37 | double lat; // 地区/城市纬度 (39.956074) 38 | double lon; // 地区/城市经度 (116.310316) 39 | QString parent_city; // 该地区/城市的上级城市 (北京) 40 | QString admin_area; // 该地区/城市所属行政区域 (北京) 41 | QString cnty; // 该地区/城市所属国家名称 (中国) 42 | double tz; // 该地区/城市所在时区 (+8.0) 43 | }; 44 | // 更新时间 45 | struct WeatherUpdateTime 46 | { 47 | QDateTime localTime; 48 | QDateTime utcTime; 49 | }; 50 | // 状态码 51 | struct WeatherStatus 52 | { 53 | QString statusCode; // 状态码 54 | QString note; // 提示说明 55 | }; 56 | 57 | public: 58 | static WeatherInterface *getInstance(void); 59 | 60 | private: 61 | WeatherInterface(QObject *parent = nullptr); 62 | ~WeatherInterface(); 63 | 64 | public: 65 | // 设置是否设置代理 66 | void setConfigNetWorkProxy(bool); 67 | // 更新当前信息 68 | void updateData(void); 69 | // 设置当前信息类型 70 | void setCurrentWeatherInfoType(WeatherGetType type); 71 | // 设置当前城市 72 | void setCurrentCityName(QString); 73 | // 获取当前城市 74 | QString getCurrentCityName(void); 75 | // 设置空气质量检测城市 76 | void setAirQualityCityName(QString); 77 | 78 | // 获取天气的基础信息 79 | WeatherBaseData getBaseData(void); 80 | // 获取更新时间信息 81 | WeatherUpdateTime getUpdateTime(void); 82 | // 获取天气预报信息 83 | QList getDailyForecast(void); 84 | // 获取当时天气信息 85 | WeatherNow::WeatherNowInfo getNowWeatherInfo(void); 86 | // 获取当前的生活指数 87 | QList getLifeStyleInfoList(void); 88 | // 获取当前的空气质量 89 | WeatherAirNow::AirQualityCity getAirQualityCity(void); 90 | // 获取当前控制质量的颜色 91 | QColor getAirQualityCityColor(void); 92 | // 刷新天气信息 93 | void updateWeatherInfo(void); 94 | 95 | // 获取天气图标 96 | QString getWeatherIcon(int code); 97 | 98 | protected: 99 | QString getReplayData(QString attrValue, QMap map); 100 | QString getReplayData(void); 101 | 102 | private: 103 | QString m_PrivateKey; // Key 104 | 105 | QNetworkAccessManager *m_Manager; 106 | 107 | // 是否设置代理 108 | bool m_IsConfigNetWorkProxy = false; 109 | // 要获取的天气类型 110 | WeatherGetType m_WeatherGetType; 111 | // 天气类型-类列表 112 | QMap m_TypeInterfaceMap; 113 | // 初始化数据 114 | void initData(void); 115 | // 根据类型获取URL中的缺省值 116 | QString getURLAttrStringByType(WeatherGetType type); 117 | // Json解析 118 | void disposeWeatherJsonData(QString); 119 | 120 | // 当前的城市信息 121 | QString m_LocationCity; 122 | // 当前空气质量检测城市 123 | QString m_AirQualityCity; 124 | // 天气的基础信息 125 | WeatherBaseData m_WeatherBaseData; 126 | // 更新时间信息 127 | WeatherUpdateTime m_WeatherTime; 128 | // 状态码信息 129 | WeatherStatus m_WeatherStatus; 130 | 131 | // 获取状态码的说明字符串 132 | QString getStatusCodeNote(QString statusCode); 133 | }; 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /WeatherApi/WeatherLife.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherLife.h" 2 | #include 3 | #include 4 | 5 | WeatherLife::WeatherLife() 6 | { 7 | m_LifeStyleDataList.clear(); 8 | } 9 | 10 | WeatherLife::~WeatherLife() 11 | { 12 | 13 | } 14 | 15 | void WeatherLife::disposeWeatherInfo(QJsonObject &jsonObject) 16 | { 17 | if (jsonObject.contains("lifestyle")) 18 | { 19 | if (!jsonObject.value("lifestyle").isArray()) 20 | return; 21 | 22 | QJsonArray jsonArray = jsonObject.value("lifestyle").toArray(); 23 | for (int i=0; i WeatherLife::getLifeStyleInfoList(void) 38 | { 39 | return m_LifeStyleDataList; 40 | } 41 | 42 | QString WeatherLife::convertToString(LifeStyleType type) 43 | { 44 | if (LifeStyle_Comf == type) 45 | return "舒适度指数"; 46 | else if (LifeStyle_Cw == type) 47 | return "洗车指数"; 48 | else if (LifeStyle_Drsg == type) 49 | return "穿衣指数"; 50 | else if (LifeStyle_Flu == type) 51 | return "感冒指数"; 52 | else if (LifeStyle_Sport == type) 53 | return "运动指数"; 54 | else if (LifeStyle_Trav == type) 55 | return "旅游指数"; 56 | else if (LifeStyle_Uv == type) 57 | return "紫外线指数"; 58 | else if (LifeStyle_Air == type) 59 | return "空气污染扩散条件指数"; 60 | else if (LifeStyle_Ac == type) 61 | return "空调开启指数"; 62 | else if (LifeStyle_Ag == type) 63 | return "过敏指数"; 64 | else if (LifeStyle_Gl == type) 65 | return "太阳镜指数"; 66 | else if (LifeStyle_Mu == type) 67 | return "化妆指数"; 68 | else if (LifeStyle_Airc == type) 69 | return "晾晒指数"; 70 | else if (LifeStyle_Ptfc == type) 71 | return "交通指数"; 72 | else if (LifeStyle_Fsh == type) 73 | return "钓鱼指数"; 74 | else if (LifeStyle_Spi == type) 75 | return "防晒指数"; 76 | } 77 | 78 | WeatherLife::LifeStyleType WeatherLife::lifeStyleStringToType(QString lifeStyleString) 79 | { 80 | if (lifeStyleString == "comf") 81 | return LifeStyle_Comf; 82 | else if (lifeStyleString == "cw") 83 | return LifeStyle_Cw; 84 | else if (lifeStyleString == "drsg") 85 | return LifeStyle_Drsg; 86 | else if (lifeStyleString == "flu") 87 | return LifeStyle_Flu; 88 | else if (lifeStyleString == "sport") 89 | return LifeStyle_Sport; 90 | else if (lifeStyleString == "trav") 91 | return LifeStyle_Trav; 92 | else if (lifeStyleString == "uv") 93 | return LifeStyle_Uv; 94 | else if (lifeStyleString == "air") 95 | return LifeStyle_Air; 96 | else if (lifeStyleString == "ac") 97 | return LifeStyle_Ac; 98 | else if (lifeStyleString == "ag") 99 | return LifeStyle_Ag; 100 | else if (lifeStyleString == "gl") 101 | return LifeStyle_Gl; 102 | else if (lifeStyleString == "mu") 103 | return LifeStyle_Mu; 104 | else if (lifeStyleString == "airc") 105 | return LifeStyle_Airc; 106 | else if (lifeStyleString == "cw") 107 | return LifeStyle_Cw; 108 | else if (lifeStyleString == "ptfc") 109 | return LifeStyle_Ptfc; 110 | else if (lifeStyleString == "fsh") 111 | return LifeStyle_Fsh; 112 | else if (lifeStyleString == "spi") 113 | return LifeStyle_Spi; 114 | } 115 | -------------------------------------------------------------------------------- /WeatherApi/WeatherLife.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_LIFE_H 2 | #define WEATHER_LIFE_H 3 | 4 | #include "WeatherBaseInfo.h" 5 | #include 6 | 7 | class WeatherLife : public WeatherBaseInfo 8 | { 9 | Q_OBJECT 10 | public: 11 | enum LifeStyleType 12 | { 13 | LifeStyle_Comf, // 舒适度指数 14 | LifeStyle_Cw, // 洗车指数 15 | LifeStyle_Drsg, // 穿衣指数 16 | LifeStyle_Flu, // 感冒指数 17 | LifeStyle_Sport, // 运动指数 18 | LifeStyle_Trav, // 旅游指数 19 | LifeStyle_Uv, // 紫外线指数 20 | LifeStyle_Air, // 空气污染扩散条件指数 21 | LifeStyle_Ac, // 空调开启指数 22 | LifeStyle_Ag, // 过敏指数 23 | LifeStyle_Gl, // 太阳镜指数 24 | LifeStyle_Mu, // 化妆指数 25 | LifeStyle_Airc, // 晾晒指数 26 | LifeStyle_Ptfc, // 交通指数 27 | LifeStyle_Fsh, // 钓鱼指数 28 | LifeStyle_Spi // 防晒指数 29 | }; 30 | 31 | struct LifeStyleData 32 | { 33 | QString brf; 34 | QString valueText; 35 | LifeStyleType lifeStyleType; 36 | }; 37 | 38 | public: 39 | WeatherLife(); 40 | ~WeatherLife(); 41 | 42 | // 处理生活指数的数据 43 | void disposeWeatherInfo(QJsonObject &jsonObject) override; 44 | // 获取生活指数列表 45 | QList getLifeStyleInfoList(void); 46 | // 枚举类型转换为字符串 47 | static QString convertToString(LifeStyleType); 48 | 49 | private: 50 | QList m_LifeStyleDataList; 51 | 52 | // 指数字符串转换为枚举类型 53 | LifeStyleType lifeStyleStringToType(QString); 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /WeatherApi/WeatherNow.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherNow.h" 2 | #include 3 | #include 4 | #include 5 | 6 | WeatherNow::WeatherNow() 7 | { 8 | 9 | } 10 | 11 | WeatherNow::~WeatherNow() 12 | { 13 | 14 | } 15 | 16 | WeatherNow::WeatherNowInfo WeatherNow::getNowWeatherInfo(void) 17 | { 18 | return m_WeatherNowInfo; 19 | } 20 | 21 | void WeatherNow::disposeWeatherInfo(QJsonObject &jsonObjects) 22 | { 23 | // 解析天气预报 24 | if (jsonObjects.contains("now")) 25 | { 26 | QJsonObject jsonObject = jsonObjects.value("now").toObject(); 27 | m_WeatherNowInfo.fl = jsonObject.value("fl").toString().toInt(); // 体感温度,默认单位:摄氏度 23 28 | m_WeatherNowInfo.tmp = jsonObject.value("tmp").toString().toInt(); // 温度,默认单位:摄氏度 21 29 | m_WeatherNowInfo.cond_code = jsonObject.value("cond_code").toString().toInt(); // 实况天气状况代码 100 30 | m_WeatherNowInfo.cond_txt = jsonObject.value("cond_txt").toString(); // 实况天气状况代码 晴 31 | m_WeatherNowInfo.wind_deg = jsonObject.value("wind_deg").toString().toInt(); // 风向360角度 305 32 | m_WeatherNowInfo.wind_dir = jsonObject.value("wind_dir").toString(); // 风向 西北 33 | m_WeatherNowInfo.wind_sc = jsonObject.value("wind_sc").toString().toInt(); // 风力 3 34 | m_WeatherNowInfo.wind_spd = jsonObject.value("wind_spd").toString().toInt(); // 风速,公里/小时 15 35 | m_WeatherNowInfo.hum = jsonObject.value("hum").toString().toInt(); // 相对湿度 40 36 | m_WeatherNowInfo.pcpn = jsonObject.value("pcpn").toString().toInt(); // 降水量 0 37 | m_WeatherNowInfo.pres = jsonObject.value("pres").toString().toInt(); // 大气压强 1020 38 | m_WeatherNowInfo.vis = jsonObject.value("vis").toString().toInt(); // 能见度,默认单位:公里 10 39 | m_WeatherNowInfo.cloud = jsonObject.value("cloud").toString().toInt(); // 云量 23 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /WeatherApi/WeatherNow.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_NOE_H 2 | #define WEATHER_NOE_H 3 | 4 | #include "WeatherBaseInfo.h" 5 | 6 | class WeatherNow : public WeatherBaseInfo 7 | { 8 | Q_OBJECT 9 | public: 10 | struct WeatherNowInfo 11 | { 12 | int fl; // 体感温度,默认单位:摄氏度 23 13 | int tmp; // 温度,默认单位:摄氏度 21 14 | int cond_code; // 实况天气状况代码 100 15 | QString cond_txt; // 实况天气状况代码 晴 16 | int wind_deg; // 风向360角度 305 17 | QString wind_dir; // 风向 西北 18 | int wind_sc; // 风力 3 19 | int wind_spd; // 风速,公里/小时 15 20 | int hum; // 相对湿度 40 21 | int pcpn; // 降水量 0 22 | int pres; // 大气压强 1020 23 | int vis; // 能见度,默认单位:公里 10 24 | int cloud; // 云量 23 25 | }; 26 | 27 | public: 28 | WeatherNow(); 29 | ~WeatherNow(); 30 | 31 | // 获取天气数据 32 | WeatherNowInfo getNowWeatherInfo(void); 33 | 34 | // 处理预报的数据 35 | void disposeWeatherInfo(QJsonObject &jsonObject) override; 36 | 37 | private: 38 | WeatherNowInfo m_WeatherNowInfo; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /WeatherSystem.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2018-06-16T16:36:31 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network xml 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = WeatherSystem 12 | TEMPLATE = app 13 | RC_ICONS = app.ico 14 | 15 | CONFIG += c++11 16 | MOC_DIR += $$PWD/temp 17 | OBJECTS_DIR += $$PWD/temp 18 | DESTDIR += $$PWD/bin 19 | 20 | SOURCES += main.cpp \ 21 | UIBase/UIBaseWindow.cpp \ 22 | UIBase/UIGlobalConfig.cpp \ 23 | UIBase/UIGlobalTool.cpp \ 24 | UIBase/UIMessageBox.cpp \ 25 | UIBase/UIProgressWindow.cpp \ 26 | WeatherApi/WeatherInterface.cpp \ 27 | WeatherApi/WeatherForecast.cpp \ 28 | WeatherUI/WeatherMainWindow.cpp \ 29 | WeatherApi/WeatherNow.cpp \ 30 | WeatherApi/WeatherBaseInfo.cpp \ 31 | WeatherApi/WeatherLife.cpp \ 32 | WeatherApi/WeatherAirNow.cpp \ 33 | WeatherUI/WeatherForecastItem.cpp \ 34 | WeatherUI/WeatherCenterWidget.cpp \ 35 | WeatherUI/WeatherCityChangeWindow.cpp \ 36 | UIBase/UIChinaCity.cpp 37 | 38 | HEADERS += \ 39 | UIBase/UIBaseWindow.h \ 40 | UIBase/UIGlobalConfig.h \ 41 | UIBase/UIGlobalTool.h \ 42 | UIBase/UIMessageBox.h \ 43 | UIBase/UIProgressWindow.h \ 44 | WeatherApi/WeatherInterface.h \ 45 | WeatherApi/WeatherForecast.h \ 46 | WeatherUI/WeatherMainWindow.h \ 47 | WeatherApi/WeatherNow.h \ 48 | WeatherApi/WeatherBaseInfo.h \ 49 | WeatherApi/WeatherLife.h \ 50 | WeatherApi/WeatherAirNow.h \ 51 | WeatherUI/WeatherForecastItem.h \ 52 | WeatherUI/WeatherCenterWidget.h \ 53 | WeatherUI/WeatherCityChangeWindow.h \ 54 | UIBase/UIChinaCity.h 55 | -------------------------------------------------------------------------------- /WeatherSystem.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {6a3b68e2-fa5b-4bc5-97c5-53577b42dddb} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.5.1 MinGW 32bit 62 | Desktop Qt 5.5.1 MinGW 32bit 63 | qt.55.win32_mingw492_kit 64 | 0 65 | 0 66 | 0 67 | 68 | G:/work/WeatherSystem 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | true 76 | 77 | false 78 | false 79 | false 80 | 81 | 82 | true 83 | Make 84 | 85 | Qt4ProjectManager.MakeStep 86 | 87 | false 88 | -j4 89 | 90 | 91 | 2 92 | 构建 93 | 94 | ProjectExplorer.BuildSteps.Build 95 | 96 | 97 | 98 | true 99 | Make 100 | 101 | Qt4ProjectManager.MakeStep 102 | 103 | true 104 | clean 105 | 106 | 107 | 1 108 | 清理 109 | 110 | ProjectExplorer.BuildSteps.Clean 111 | 112 | 2 113 | false 114 | 115 | Debug 116 | 117 | Qt4ProjectManager.Qt4BuildConfiguration 118 | 2 119 | true 120 | 121 | 122 | G:/work/build-WeatherSystem-Desktop_Qt_5_5_1_MinGW_32bit-Release 123 | 124 | 125 | true 126 | qmake 127 | 128 | QtProjectManager.QMakeBuildStep 129 | false 130 | 131 | false 132 | false 133 | false 134 | 135 | 136 | true 137 | Make 138 | 139 | Qt4ProjectManager.MakeStep 140 | 141 | false 142 | 143 | 144 | 145 | 2 146 | 构建 147 | 148 | ProjectExplorer.BuildSteps.Build 149 | 150 | 151 | 152 | true 153 | Make 154 | 155 | Qt4ProjectManager.MakeStep 156 | 157 | true 158 | clean 159 | 160 | 161 | 1 162 | 清理 163 | 164 | ProjectExplorer.BuildSteps.Clean 165 | 166 | 2 167 | false 168 | 169 | Release 170 | 171 | Qt4ProjectManager.Qt4BuildConfiguration 172 | 0 173 | true 174 | 175 | 176 | G:/work/build-WeatherSystem-Desktop_Qt_5_5_1_MinGW_32bit-Profile 177 | 178 | 179 | true 180 | qmake 181 | 182 | QtProjectManager.QMakeBuildStep 183 | true 184 | 185 | false 186 | true 187 | false 188 | 189 | 190 | true 191 | Make 192 | 193 | Qt4ProjectManager.MakeStep 194 | 195 | false 196 | 197 | 198 | 199 | 2 200 | 构建 201 | 202 | ProjectExplorer.BuildSteps.Build 203 | 204 | 205 | 206 | true 207 | Make 208 | 209 | Qt4ProjectManager.MakeStep 210 | 211 | true 212 | clean 213 | 214 | 215 | 1 216 | 清理 217 | 218 | ProjectExplorer.BuildSteps.Clean 219 | 220 | 2 221 | false 222 | 223 | Profile 224 | 225 | Qt4ProjectManager.Qt4BuildConfiguration 226 | 0 227 | true 228 | 229 | 3 230 | 231 | 232 | 0 233 | 部署 234 | 235 | ProjectExplorer.BuildSteps.Deploy 236 | 237 | 1 238 | 在本地部署 239 | 240 | ProjectExplorer.DefaultDeployConfiguration 241 | 242 | 1 243 | 244 | 245 | false 246 | 1000 247 | 248 | true 249 | 250 | false 251 | false 252 | false 253 | false 254 | true 255 | 0.01 256 | 10 257 | true 258 | 1 259 | 25 260 | 261 | 1 262 | true 263 | false 264 | true 265 | valgrind 266 | 267 | 0 268 | 1 269 | 2 270 | 3 271 | 4 272 | 5 273 | 6 274 | 7 275 | 8 276 | 9 277 | 10 278 | 11 279 | 12 280 | 13 281 | 14 282 | 283 | 2 284 | 285 | WeatherSystem 286 | 287 | Qt4ProjectManager.Qt4RunConfiguration:G:/work/WeatherSystem/WeatherSystem.pro 288 | true 289 | 290 | WeatherSystem.pro 291 | false 292 | false 293 | 294 | 3768 295 | false 296 | true 297 | false 298 | false 299 | true 300 | 301 | 1 302 | 303 | 304 | 305 | ProjectExplorer.Project.TargetCount 306 | 1 307 | 308 | 309 | ProjectExplorer.Project.Updater.FileVersion 310 | 18 311 | 312 | 313 | Version 314 | 18 315 | 316 | 317 | -------------------------------------------------------------------------------- /WeatherUI/WeatherCenterWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherCenterWidget.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "WeatherApi/WeatherInterface.h" 8 | 9 | WeatherCenterWidget::WeatherCenterWidget(QWidget *parent) 10 | :QWidget(parent) 11 | { 12 | m_CurrentCity = "北京"; 13 | m_ChangeCityRect = QRect(50, 20, 30, 25); 14 | this->setMouseTracking(true); 15 | 16 | refreshImage = QPixmap("./Icons/refresh.png"); 17 | refreshImageH = QPixmap("./Icons/refreshH.png"); 18 | 19 | m_WeatherCityChangeWindow = new WeatherCityChangeWindow; 20 | m_WeatherCityChangeWindow->hide(); 21 | QObject::connect(m_WeatherCityChangeWindow, SIGNAL(changeCity()), this, SLOT(onUpdateChangeCity())); 22 | //m_WeatherCityChangeWindow->show(); 23 | } 24 | 25 | WeatherCenterWidget::~WeatherCenterWidget() 26 | { 27 | 28 | } 29 | 30 | void WeatherCenterWidget::paintEvent(QPaintEvent *event) 31 | { 32 | // 更新数据信息 33 | updateData(); 34 | 35 | QPainter painter(this); 36 | // 设置画笔和画刷 37 | painter.setPen(QPen(QColor(230, 230, 230))); 38 | QLinearGradient lineGradient(0, 0, 0, this->rect().height()); 39 | lineGradient.setColorAt(0.0, QColor(80, 80, 80)); 40 | lineGradient.setColorAt(1.0, QColor(200, 200, 200)); 41 | painter.fillRect(this->rect(), QBrush(lineGradient)); 42 | // 绘制城市信息 43 | drawCityInfo(&painter, QRect(10, 20, 80, 50)); 44 | // 绘制刷新 45 | drawRefreshIcon(&painter, QRect(this->width() - 10 - 50, 28, 32, 32)); 46 | // 绘制天气基本信息 47 | drawWeatherBaseInfo(&painter, QRect(0, 0, this->width(), this->height())); 48 | // 绘制生活指数 49 | painter.setPen(QPen(QColor(60, 60, 60))); 50 | drawLifeStyleInfo(&painter, QRect(5, this->height() - 30, this->width(), 30)); 51 | 52 | return QWidget::paintEvent(event); 53 | } 54 | 55 | void WeatherCenterWidget::mouseMoveEvent(QMouseEvent *event) 56 | { 57 | QPoint pos = event->pos(); 58 | if (m_ChangeCityRect.contains(pos)) 59 | { 60 | m_IsHoverChanged = true; 61 | this->setCursor(Qt::PointingHandCursor); 62 | } 63 | else if (m_RefreshRect.contains(pos)) 64 | { 65 | m_IsHoverRefresh = true; 66 | this->setCursor(Qt::PointingHandCursor); 67 | } 68 | else 69 | { 70 | m_IsHoverChanged = false; 71 | m_IsHoverRefresh = false; 72 | this->setCursor(Qt::ArrowCursor); 73 | } 74 | 75 | this->repaint(); 76 | return QWidget::mouseMoveEvent(event); 77 | } 78 | 79 | void WeatherCenterWidget::mouseReleaseEvent(QMouseEvent *event) 80 | { 81 | if (m_IsHoverChanged) 82 | m_WeatherCityChangeWindow->show(); 83 | else if (m_IsHoverRefresh) 84 | { 85 | g_WeatherInterface->updateWeatherInfo(); 86 | this->repaint(); 87 | } 88 | return QWidget::mouseReleaseEvent(event); 89 | } 90 | 91 | void WeatherCenterWidget::resizeEvent(QResizeEvent *event) 92 | { 93 | m_RefreshRect = QRect(this->width() - 10 - 50, 28, 32, 32); 94 | return QWidget::resizeEvent(event); 95 | } 96 | 97 | void WeatherCenterWidget::drawCityInfo(QPainter *painter, QRect rect) 98 | { 99 | painter->save(); 100 | QTextOption o; 101 | o.setAlignment(Qt::AlignLeft); 102 | 103 | // 绘制城市 104 | painter->drawText(QRect(rect.x(), rect.y(), rect.width(), rect.height() / 2), m_CurrentCity, o); 105 | 106 | // 绘制更换 107 | if (m_IsHoverChanged) 108 | painter->setPen(QPen(QColor(100, 100, 200))); 109 | o.setAlignment(Qt::AlignRight); 110 | painter->drawText(QRect(rect.x(), rect.y(), rect.width(), rect.height() / 2), "更换", o); 111 | 112 | // 绘制时间信息 113 | painter->setPen(QPen(QColor(230, 230, 230))); 114 | o.setAlignment(Qt::AlignLeft); 115 | QString currentTimeString = QDate::currentDate().toString("yyyy-MM-dd"); 116 | painter->drawText(QRect(rect.x(), rect.y() + rect.height() / 2, rect.width(), rect.height() / 2), \ 117 | currentTimeString, o); 118 | painter->restore(); 119 | } 120 | 121 | void WeatherCenterWidget::drawWeatherBaseInfo(QPainter *painter, QRect rect) 122 | { 123 | painter->save(); 124 | 125 | QFont font; 126 | font.setPixelSize(85); 127 | painter->setFont(font); 128 | 129 | int midddleHeight = 60; 130 | QTextOption o; 131 | o.setAlignment(Qt::AlignCenter | Qt::AlignBottom); 132 | // 绘制温度 133 | painter->drawText(QRect(rect.x(), rect.y(), rect.width(), rect.height() / 2 - midddleHeight / 2), \ 134 | m_CurrentTem, o); 135 | 136 | // 绘制天气信息 137 | font.setPixelSize(40); 138 | painter->setFont(font); 139 | o.setAlignment(Qt::AlignCenter); 140 | painter->drawText(QRect(rect.x(), rect.y() + rect.height() / 2 - midddleHeight / 2, \ 141 | rect.width(), midddleHeight), m_CurrentWeather, o); 142 | 143 | // 绘制空气质量 144 | font.setPixelSize(30); 145 | painter->setFont(font); 146 | QColor color = g_WeatherInterface->getAirQualityCityColor(); 147 | painter->setPen(QPen(color)); 148 | o.setAlignment(Qt::AlignHCenter | Qt::AlignTop); 149 | painter->drawText(QRect(rect.x(), rect.y() + rect.height() / 2 + midddleHeight / 2, \ 150 | rect.width(), rect.height() / 2 - midddleHeight / 2), \ 151 | m_AirQualityString, o); 152 | 153 | painter->restore(); 154 | } 155 | 156 | void WeatherCenterWidget::drawLifeStyleInfo(QPainter *painter, QRect rect) 157 | { 158 | QFont font; 159 | font.setPixelSize(15); 160 | painter->setFont(font); 161 | painter->drawText(rect, m_LifeStyleString); 162 | } 163 | 164 | void WeatherCenterWidget::drawRefreshIcon(QPainter *painter, QRect rect) 165 | { 166 | if (!m_IsHoverRefresh) 167 | painter->drawPixmap(rect, refreshImage); 168 | else 169 | painter->drawPixmap(rect, refreshImageH); 170 | } 171 | 172 | void WeatherCenterWidget::updateData(void) 173 | { 174 | m_CurrentCity = g_WeatherInterface->getCurrentCityName(); 175 | m_CurrentTem = QString::number(g_WeatherInterface->getNowWeatherInfo().tmp) + "℃"; 176 | 177 | QString currentWeatherString = "%1 / %2%3级"; 178 | currentWeatherString = currentWeatherString.arg(g_WeatherInterface->getNowWeatherInfo().cond_txt).\ 179 | arg(g_WeatherInterface->getNowWeatherInfo().wind_dir).\ 180 | arg(g_WeatherInterface->getNowWeatherInfo().wind_sc); 181 | m_CurrentWeather = currentWeatherString; 182 | 183 | QString airQualityString = "%1 %2"; 184 | airQualityString = airQualityString.arg(g_WeatherInterface->getAirQualityCity().aqi). \ 185 | arg(g_WeatherInterface->getAirQualityCity().qlty); 186 | m_AirQualityString = airQualityString; 187 | 188 | // 更新生活指数 189 | if (g_WeatherInterface->getLifeStyleInfoList().count() > 0) 190 | { 191 | if (m_Timer == nullptr) 192 | { 193 | QList lifeStyleList = g_WeatherInterface->getLifeStyleInfoList(); 194 | m_LifeStyleString = WeatherLife::convertToString(lifeStyleList.at(0).lifeStyleType) + ": " + \ 195 | lifeStyleList.at(0).brf + "; " + lifeStyleList.at(0).valueText; 196 | m_Timer = new QTimer(this); 197 | m_Timer->setInterval(4000); 198 | m_Timer->start(); 199 | QObject::connect(m_Timer, &QTimer::timeout, this, &WeatherCenterWidget::onTimeOut); 200 | } 201 | } 202 | } 203 | 204 | void WeatherCenterWidget::onTimeOut(void) 205 | { 206 | QList lifeStyleList = g_WeatherInterface->getLifeStyleInfoList(); 207 | if (++m_LefeStyleIndex >= lifeStyleList.count()) 208 | m_LefeStyleIndex = 0; 209 | m_LifeStyleString = WeatherLife::convertToString(lifeStyleList.at(m_LefeStyleIndex).lifeStyleType) + ": " + \ 210 | lifeStyleList.at(m_LefeStyleIndex).brf + "; " + lifeStyleList.at(m_LefeStyleIndex).valueText; 211 | this->update(); 212 | } 213 | 214 | void WeatherCenterWidget::onUpdateChangeCity(void) 215 | { 216 | g_WeatherInterface->updateWeatherInfo(); 217 | this->update(); 218 | } 219 | -------------------------------------------------------------------------------- /WeatherUI/WeatherCenterWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_CENTER_WIDGET_H 2 | #define WEATHER_CENTER_WIDGET_H 3 | 4 | #include 5 | #include "WeatherCityChangeWindow.h" 6 | 7 | class WeatherCenterWidget : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | WeatherCenterWidget(QWidget *parent = nullptr); 13 | ~WeatherCenterWidget(); 14 | 15 | protected: 16 | void paintEvent(QPaintEvent *event) override; 17 | void mouseMoveEvent(QMouseEvent *event) override; 18 | void mouseReleaseEvent(QMouseEvent *event) override; 19 | void resizeEvent(QResizeEvent *event) override; 20 | 21 | private: 22 | // 当前所在城市 23 | QString m_CurrentCity; 24 | // 当前的温度 25 | QString m_CurrentTem; 26 | // 当前的天气情况 27 | QString m_CurrentWeather; 28 | // 空气质量 29 | QString m_AirQualityString; 30 | // 生活指数 31 | QString m_LifeStyleString; 32 | QTimer *m_Timer = nullptr; 33 | int m_LefeStyleIndex = 0; 34 | // 刷新图标 35 | QPixmap refreshImage; 36 | QPixmap refreshImageH; 37 | 38 | // 城市更改的区域位置 39 | QRect m_ChangeCityRect; 40 | bool m_IsHoverChanged = false; 41 | QRect m_RefreshRect; 42 | bool m_IsHoverRefresh = false; 43 | 44 | // 绘制城市信息 45 | void drawCityInfo(QPainter *painter, QRect rect); 46 | // 绘制温度等基本信息 47 | void drawWeatherBaseInfo(QPainter *painter, QRect rect); 48 | // 绘制生活指数 49 | void drawLifeStyleInfo(QPainter *painter, QRect rect); 50 | // 绘制刷新图标 51 | void drawRefreshIcon(QPainter *painter, QRect rect); 52 | 53 | // 更新信息 54 | void updateData(void); 55 | 56 | WeatherCityChangeWindow *m_WeatherCityChangeWindow = nullptr; 57 | 58 | private slots: 59 | void onTimeOut(void); 60 | void onUpdateChangeCity(void); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /WeatherUI/WeatherCityChangeWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherCityChangeWindow.h" 2 | #include 3 | #include "WeatherApi/WeatherInterface.h" 4 | #include "UIBase/UIGlobalTool.h" 5 | #include 6 | 7 | WeatherCityChangeWindow::WeatherCityChangeWindow(QWidget *parent) 8 | :UIBaseWindow(parent) 9 | { 10 | QVBoxLayout *layout = new QVBoxLayout(this); 11 | layout->addSpacing(30); 12 | 13 | chinaCityManager = new UIChinaCity(this); 14 | 15 | QWidget *mainWidget = new QWidget(this); 16 | QVBoxLayout *bottomLayout = new QVBoxLayout(mainWidget); 17 | 18 | // 初始化下拉Tag 19 | QHBoxLayout *tagLabelLayout = new QHBoxLayout; 20 | m_StateLabel = new QLabel("省/直辖市"); 21 | m_CityLabel = new QLabel("城市/直辖市区"); 22 | m_RegionLabel = new QLabel("区/县"); 23 | tagLabelLayout->addWidget(m_StateLabel, 0, Qt::AlignCenter); 24 | tagLabelLayout->addWidget(m_CityLabel, 0, Qt::AlignCenter); 25 | tagLabelLayout->addWidget(m_RegionLabel, 0, Qt::AlignCenter); 26 | 27 | // 初始化下拉按钮 28 | QHBoxLayout *comboLayout = new QHBoxLayout; 29 | m_StateComboBox = new QComboBox; 30 | m_StateComboBox->addItems(chinaCityManager->getProvinceName()); 31 | m_StateComboBox->setView(new QListView(m_StateComboBox)); 32 | comboLayout->addWidget(m_StateComboBox); 33 | 34 | m_CityComboBox = new QComboBox; 35 | comboLayout->addWidget(m_CityComboBox); 36 | m_CityComboBox->setView(new QListView(m_CityComboBox)); 37 | 38 | m_RegionComboBox = new QComboBox; 39 | m_RegionComboBox->setView(new QListView(m_RegionComboBox)); 40 | g_GlobalTool->addShadowEffect(m_StateComboBox); 41 | g_GlobalTool->addShadowEffect(m_CityComboBox); 42 | g_GlobalTool->addShadowEffect(m_RegionComboBox); 43 | 44 | comboLayout->addWidget(m_RegionComboBox); 45 | 46 | // 初始化按钮 47 | QHBoxLayout *buttonLayout = new QHBoxLayout; 48 | m_OKButton = new QPushButton("确定"); 49 | m_CannelButton = new QPushButton("取消"); 50 | buttonLayout->addStretch(); 51 | buttonLayout->addWidget(m_OKButton); 52 | buttonLayout->addWidget(m_CannelButton); 53 | g_GlobalTool->addShadowEffect(m_OKButton); 54 | g_GlobalTool->addShadowEffect(m_CannelButton); 55 | 56 | // 添加布局 57 | bottomLayout->addLayout(tagLabelLayout); 58 | bottomLayout->addLayout(comboLayout); 59 | bottomLayout->addStretch(); 60 | bottomLayout->addLayout(buttonLayout); 61 | layout->addWidget(mainWidget); 62 | this->resize(500, 200); 63 | 64 | // 建立信号和槽的连接 65 | QObject::connect(m_StateComboBox, SIGNAL(currentIndexChanged(int)), \ 66 | this, SLOT(onStateComboBoxIndexChanged(int))); 67 | QObject::connect(m_CityComboBox, SIGNAL(currentIndexChanged(int)), \ 68 | this, SLOT(onCityComboBoxIndexChanged(int))); 69 | QObject::connect(m_OKButton, SIGNAL(clicked(bool)), this, SLOT(onOKClicked())); 70 | QObject::connect(m_CannelButton, SIGNAL(clicked(bool)), this, SLOT(onCannelClicked())); 71 | 72 | // 初始化值 73 | m_StateComboBox->setCurrentText("北京"); 74 | m_CityComboBox->setCurrentText("昌平"); 75 | 76 | this->setCustomerWindowTitle("日丽天气 V1.0 - by Douzhq"); 77 | } 78 | 79 | WeatherCityChangeWindow::~WeatherCityChangeWindow() 80 | { 81 | 82 | } 83 | 84 | void WeatherCityChangeWindow::onStateComboBoxIndexChanged(int index) 85 | { 86 | QString nProvinceName = m_StateComboBox->currentText(); 87 | QList cityNameList = chinaCityManager->getCitysName(nProvinceName); 88 | m_CityComboBox->clear(); 89 | m_RegionComboBox->clear(); 90 | m_CityComboBox->addItems(cityNameList); 91 | } 92 | 93 | void WeatherCityChangeWindow::onCityComboBoxIndexChanged(int index) 94 | { 95 | QString nProvinceName = m_StateComboBox->currentText(); 96 | QString nCityName = m_CityComboBox->currentText(); 97 | 98 | QList regionNameList = chinaCityManager->getRegionsName(nProvinceName, nCityName); 99 | m_RegionComboBox->clear(); 100 | 101 | m_RegionComboBox->addItems(regionNameList); 102 | } 103 | 104 | void WeatherCityChangeWindow::onOKClicked(void) 105 | { 106 | if (m_RegionComboBox->currentText().isEmpty()) 107 | { 108 | g_WeatherInterface->setCurrentCityName(m_CityComboBox->currentText()); 109 | g_WeatherInterface->setAirQualityCityName(m_StateComboBox->currentText()); 110 | } 111 | else 112 | { 113 | g_WeatherInterface->setCurrentCityName(m_RegionComboBox->currentText()); 114 | g_WeatherInterface->setAirQualityCityName(m_CityComboBox->currentText()); 115 | } 116 | emit changeCity(); 117 | this->close(); 118 | } 119 | 120 | void WeatherCityChangeWindow::onCannelClicked(void) 121 | { 122 | this->close(); 123 | } 124 | -------------------------------------------------------------------------------- /WeatherUI/WeatherCityChangeWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_CITY_CHANGE_WINDOW_H 2 | #define WEATHER_CITY_CHANGE_WINDOW_H 3 | #include "UIBase/UIBaseWindow.h" 4 | #include 5 | #include 6 | #include 7 | #include "UIBase/UIChinaCity.h" 8 | 9 | class WeatherCityChangeWindow : public UIBaseWindow 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | WeatherCityChangeWindow(QWidget *parent = nullptr); 15 | ~WeatherCityChangeWindow(); 16 | 17 | private: 18 | QComboBox *m_StateComboBox = nullptr; 19 | QComboBox *m_CityComboBox = nullptr; 20 | QComboBox *m_RegionComboBox = nullptr; 21 | 22 | QLabel *m_StateLabel; 23 | QLabel *m_CityLabel; 24 | QLabel *m_RegionLabel; 25 | 26 | QPushButton *m_OKButton; 27 | QPushButton *m_CannelButton; 28 | 29 | UIChinaCity *chinaCityManager = nullptr; 30 | 31 | private slots: 32 | void onStateComboBoxIndexChanged(int); 33 | void onCityComboBoxIndexChanged(int); 34 | void onOKClicked(void); 35 | void onCannelClicked(void); 36 | 37 | signals: 38 | void changeCity(void); 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /WeatherUI/WeatherForecastItem.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherForecastItem.h" 2 | #include 3 | #include 4 | #include "WeatherApi/WeatherInterface.h" 5 | 6 | WeatherForecastItem::WeatherForecastItem(int index, QWidget *parent) 7 | :QWidget(parent) 8 | { 9 | m_Index = index; 10 | this->setProperty("ItemWidget", "ItemWidget"); 11 | } 12 | 13 | WeatherForecastItem::~WeatherForecastItem() 14 | { 15 | 16 | } 17 | 18 | void WeatherForecastItem::paintEvent(QPaintEvent *event) 19 | { 20 | updateData(); 21 | QPainter painter(this); 22 | 23 | QStyleOption opt; 24 | opt.init(this); 25 | style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); 26 | 27 | int width = this->width(); 28 | int height = this->height(); 29 | 30 | // 绘制时间 31 | drawDateTime(&painter, QRect(0, 2, width, height * 1.0 / 4)); 32 | // 绘制图片 33 | int imageWidth = height / 2 - 8; 34 | int xPt = (width - imageWidth) / 2; 35 | int yPt = height * 1.0 / 4 + (height / 2 - imageWidth) / 2; 36 | drawWeatherImage(&painter, QRect(xPt, yPt, imageWidth, imageWidth)); 37 | // 绘制天气和温度 38 | drawWeatherAndTemperature(&painter, QRect(0, height * 1.0 / 4 * 3, width, height * 1.0 / 4 - 2)); 39 | 40 | return QWidget::paintEvent(event); 41 | } 42 | 43 | void WeatherForecastItem::drawDateTime(QPainter *painter, QRect rect) 44 | { 45 | QDate currentDate = QDate::currentDate(); 46 | int days = currentDate.daysTo(m_DateTime); 47 | QString dayString = ""; 48 | if (days == 0) 49 | dayString = "今天"; 50 | else if (days == 1) 51 | dayString = "明天"; 52 | else if (days == 2) 53 | dayString = "后天"; 54 | QString dateTimeString = m_DateTime.toString("MM/dd"); 55 | 56 | QTextOption o; 57 | o.setAlignment(Qt::AlignCenter); 58 | painter->drawText(QRect(rect.x(), rect.y(), rect.width(), rect.height() / 2), dayString, o); 59 | painter->drawText(QRect(rect.x(), rect.y() + rect.height() / 2, rect.width(), rect.height() / 2), \ 60 | dateTimeString, o); 61 | 62 | } 63 | 64 | void WeatherForecastItem::drawWeatherImage(QPainter *painter, QRect rect) 65 | { 66 | QImage image(m_IconPath); 67 | painter->drawImage(rect, image); 68 | } 69 | 70 | void WeatherForecastItem::drawWeatherAndTemperature(QPainter *painter, QRect rect) 71 | { 72 | QTextOption o; 73 | o.setAlignment(Qt::AlignCenter); 74 | painter->drawText(QRect(rect.x(), rect.y(), rect.width(), rect.height() / 2), m_WeatherString, o); 75 | painter->drawText(QRect(rect.x(), rect.y() + rect.height() / 2, rect.width(), rect.height() / 2), \ 76 | m_TemperatureString, o); 77 | } 78 | 79 | void WeatherForecastItem::updateData(void) 80 | { 81 | if (g_WeatherInterface->getDailyForecast().count() <= 0) 82 | return; 83 | 84 | m_DateTime = g_WeatherInterface->getDailyForecast().at(m_Index).date; 85 | int weatherCode = g_WeatherInterface->getDailyForecast().at(m_Index).cond_code_d; 86 | m_IconPath = g_WeatherInterface->getWeatherIcon(weatherCode); 87 | m_WeatherString = g_WeatherInterface->getDailyForecast().at(m_Index).cond_txt_d; 88 | 89 | // 设置温度字符串 90 | QString temperatureString = "%1-%2℃"; 91 | int minTmp = g_WeatherInterface->getDailyForecast().at(m_Index).tmp_min; 92 | int maxTmp = g_WeatherInterface->getDailyForecast().at(m_Index).tmp_max; 93 | temperatureString = temperatureString.arg(minTmp).arg(maxTmp); 94 | m_TemperatureString = temperatureString; 95 | } 96 | -------------------------------------------------------------------------------- /WeatherUI/WeatherForecastItem.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_FORECAST_ITEM_H 2 | #define WEATHER_FORECAST_ITEM_H 3 | 4 | #include 5 | #include 6 | #include 7 | class WeatherForecastItem : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | WeatherForecastItem(int index, QWidget *parent = nullptr); 13 | ~WeatherForecastItem(); 14 | 15 | protected: 16 | virtual void paintEvent(QPaintEvent *event) override; 17 | 18 | private: 19 | QDate m_DateTime; 20 | QString m_IconPath; 21 | QString m_WeatherString; 22 | QString m_TemperatureString; 23 | 24 | int m_Index; 25 | 26 | // 绘制时间 27 | void drawDateTime(QPainter *painter, QRect rect); 28 | // 绘制天气图标 29 | void drawWeatherImage(QPainter *painter, QRect rect); 30 | // 绘制天气和温度 31 | void drawWeatherAndTemperature(QPainter *painter, QRect rect); 32 | // 更新数据 33 | void updateData(void); 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /WeatherUI/WeatherMainWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherMainWindow.h" 2 | #include 3 | #include 4 | 5 | WeatherMainWindow::WeatherMainWindow(QWidget *parent) 6 | :UIBaseWindow(parent) 7 | { 8 | QVBoxLayout *layout = new QVBoxLayout(this); 9 | 10 | layout->addSpacing(30); 11 | 12 | m_TextEdit = new QTextEdit(); 13 | //layout->addWidget(m_TextEdit, 4); 14 | m_CenterWidget = new WeatherCenterWidget(this); 15 | layout->addWidget(m_CenterWidget, 4); 16 | 17 | QWidget *bottomWidget = new QWidget(this); 18 | QHBoxLayout *bottomLayout = new QHBoxLayout(bottomWidget); 19 | bottomLayout->setSpacing(0); 20 | bottomLayout->setMargin(2); 21 | WeatherForecastItem *weatherForecastItem1 = new WeatherForecastItem(0, this); 22 | bottomLayout->addWidget(weatherForecastItem1, 1); 23 | WeatherForecastItem *weatherForecastItem2 = new WeatherForecastItem(1, this); 24 | bottomLayout->addWidget(weatherForecastItem2, 1); 25 | WeatherForecastItem *weatherForecastItem3 = new WeatherForecastItem(2, this); 26 | bottomLayout->addWidget(weatherForecastItem3, 1); 27 | 28 | layout->addWidget(bottomWidget, 1); 29 | layout->setContentsMargins(5, 5, 5, 5); 30 | layout->setSpacing(1); 31 | 32 | this->setCustomerWindowTitle("日丽天气 V1.0 - by Douzhq"); 33 | } 34 | 35 | WeatherMainWindow::~WeatherMainWindow() 36 | { 37 | 38 | } 39 | 40 | void WeatherMainWindow::setTextEditText(QString str) 41 | { 42 | m_TextEdit->setText(str); 43 | } 44 | -------------------------------------------------------------------------------- /WeatherUI/WeatherMainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef WEATHER_MAINWINDOW_H 2 | #define WEATHER_MAINWINDOW_H 3 | 4 | #include "UIBase/UIBaseWindow.h" 5 | #include 6 | #include "WeatherForecastItem.h" 7 | #include "WeatherCenterWidget.h" 8 | 9 | class WeatherMainWindow : public UIBaseWindow 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | WeatherMainWindow(QWidget *parent = nullptr); 15 | ~WeatherMainWindow(); 16 | 17 | void setTextEditText(QString); 18 | 19 | private: 20 | QTextEdit *m_TextEdit = nullptr; 21 | WeatherCenterWidget *m_CenterWidget = nullptr; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/app.ico -------------------------------------------------------------------------------- /bin/Icons/AppIconD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/AppIconD.png -------------------------------------------------------------------------------- /bin/Icons/Cannel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/Cannel.png -------------------------------------------------------------------------------- /bin/Icons/Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/Close.png -------------------------------------------------------------------------------- /bin/Icons/Close_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/Close_H.png -------------------------------------------------------------------------------- /bin/Icons/Config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/Config.png -------------------------------------------------------------------------------- /bin/Icons/Config_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/Config_H.png -------------------------------------------------------------------------------- /bin/Icons/Confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/Confirm.png -------------------------------------------------------------------------------- /bin/Icons/MaxSizeDemo_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/MaxSizeDemo_H.png -------------------------------------------------------------------------------- /bin/Icons/MaxSizeed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/MaxSizeed.png -------------------------------------------------------------------------------- /bin/Icons/MinButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/MinButton.png -------------------------------------------------------------------------------- /bin/Icons/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/arrow-down.png -------------------------------------------------------------------------------- /bin/Icons/minButton_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/minButton_H.png -------------------------------------------------------------------------------- /bin/Icons/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/refresh.png -------------------------------------------------------------------------------- /bin/Icons/refreshH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/refreshH.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/100.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/100n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/100n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/101.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/102.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/103.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/103n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/103n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/104.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/104n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/104n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/200.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/201.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/201.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/202.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/202.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/203.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/203.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/204.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/204.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/205.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/205.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/206.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/206.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/207.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/208.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/208.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/209.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/209.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/210.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/211.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/211.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/212.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/212.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/213.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/213.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/300.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/300n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/300n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/301.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/301n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/301n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/302.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/302.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/303.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/303.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/304.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/305.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/305.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/306.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/306.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/307.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/307.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/309.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/309.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/310.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/311.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/311.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/312.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/312.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/313.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/313.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/314.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/314.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/315.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/315.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/316.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/316.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/317.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/317.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/318.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/318.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/399.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/399.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/400.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/401.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/402.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/402.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/403.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/404.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/405.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/405.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/406.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/406n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/406n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/407.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/407.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/407n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/407n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/408.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/408.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/409.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/409.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/410.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/499.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/500.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/501.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/502.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/502.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/503.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/503.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/504.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/507.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/507.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/508.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/508.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/509.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/509.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/510.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/510.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/511.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/511.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/512.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/513.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/513.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/514.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/514.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/515.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/515.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/900.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/900.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/901.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/901.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/999.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/999.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._100.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._100n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._100n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._101.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._102.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._103.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._103n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._103n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._104.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._104n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._104n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._200.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._201.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._201.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._202.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._202.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._203.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._203.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._204.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._204.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._205.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._205.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._206.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._206.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._207.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._208.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._208.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._209.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._209.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._210.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._211.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._211.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._212.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._212.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._213.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._213.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._300.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._300n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._300n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._301.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._301n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._301n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._302.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._302.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._303.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._303.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._304.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._305.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._305.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._306.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._306.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._307.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._307.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._309.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._309.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._310.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._311.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._311.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._312.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._312.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._313.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._313.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._314.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._314.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._315.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._315.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._316.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._316.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._317.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._317.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._318.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._318.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._399.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._399.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._400.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._401.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._402.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._402.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._403.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._404.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._405.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._405.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._406.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._406n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._406n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._407.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._407.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._407n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._407n.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._408.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._408.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._409.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._409.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._410.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._499.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._500.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._501.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._502.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._502.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._503.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._503.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._504.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._507.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._507.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._508.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._508.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._509.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._509.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._510.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._510.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._511.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._511.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._512.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._513.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._513.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._514.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._514.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._515.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._515.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._900.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._900.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._901.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._901.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._999.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._999.png -------------------------------------------------------------------------------- /bin/Icons/weather-icon/__MACOSX/._和风天气状况代码和图标文档.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/Icons/weather-icon/__MACOSX/._和风天气状况代码和图标文档.md -------------------------------------------------------------------------------- /bin/Icons/weather-icon/和风天气状况代码和图标文档.md: -------------------------------------------------------------------------------- 1 | #和风天气天气状况代码和图标 2 | 3 | > 更新日期:2018年5月30日,请定期访问[天气状况代码文档页](https://www.heweather.com/documents/condition)以便获取最新的天气状况代码 4 | 5 | ##天气图标 6 | ###版权 7 | 和风天气图标采用署名-非商业性使用 3.0 中国大陆 (CC BY-NC 3.0 CN)许可协议授权 8 | ###下载 9 | [图片打包下载](https://cdn.heweather.com/cond-icon-heweather.zip) 10 | ###使用 11 | * 图标文件名为天气代码,后缀为.png 12 | * 图标文件名中有字母`n`的,为夜间天气图标,例如[100n.png](https://cdn.heweather.com/cond_icon/100n.png "晴天图标") 13 | 14 | ##天气代码对照表 15 | | 代码 | 中文 | 英文 | 图标 | 16 | |---|---|---|---| 17 | | 100 | 晴 | Sunny/Clear |[100.png](https://cdn.heweather.com/cond_icon/100.png "晴天图标")| 18 | | 101 | 多云 | Cloudy | [101.png](https://cdn.heweather.com/cond_icon/101.png "多云图标") | 19 | | 102 | 少云 | Few Clouds | [102.png](https://cdn.heweather.com/cond_icon/102.png "少云图标") | 20 | | 103 | 晴间多云 | Partly Cloudy | [103.png](https://cdn.heweather.com/cond_icon/103.png "晴间多云图标") | 21 | | 104 | 阴 | Overcast | [104.png](https://cdn.heweather.com/cond_icon/104.png "阴图标") | 22 | | 200 | 有风 | Windy | [200.png](https://cdn.heweather.com/cond_icon/200.png "有风图标") | 23 | | 201 | 平静 | Calm | [201.png](https://cdn.heweather.com/cond_icon/201.png "平静图标") | 24 | | 202 | 微风 | Light Breeze | [202.png](https://cdn.heweather.com/cond_icon/202.png "微风图标") | 25 | | 203 | 和风 | Moderate/Gentle Breeze | [203.png](https://cdn.heweather.com/cond_icon/203.png "和风图标") | 26 | | 204 | 清风 | Fresh Breeze | [204.png](https://cdn.heweather.com/cond_icon/204.png "清风图标") | 27 | | 205 | 强风/劲风 | Strong Breeze | [205.png](https://cdn.heweather.com/cond_icon/205.png "强风图标") | 28 | | 206 | 疾风 | High Wind, Near Gale | [206.png](https://cdn.heweather.com/cond_icon/206.png "疾风图标") | 29 | | 207 | 大风 | Gale | [207.png](https://cdn.heweather.com/cond_icon/207.png "大风图标") | 30 | | 208 | 烈风 | Strong Gale | [208.png](https://cdn.heweather.com/cond_icon/208.png "烈风图标") | 31 | | 209 | 风暴 | Storm | [209.png](https://cdn.heweather.com/cond_icon/209.png "风暴图标") | 32 | | 210 | 狂爆风 | Violent Storm | [210.png](https://cdn.heweather.com/cond_icon/210.png "狂爆风图标") | 33 | | 211 | 飓风 | Hurricane | [211.png](https://cdn.heweather.com/cond_icon/211.png "飓风图标") | 34 | | 212 | 龙卷风 | Tornado | [212.png](https://cdn.heweather.com/cond_icon/212.png "龙卷风图标") | 35 | | 213 | 热带风暴 | Tropical Storm | [213.png](https://cdn.heweather.com/cond_icon/213.png "热带风暴图标") | 36 | | 300 | 阵雨 | Shower Rain | [300.png](https://cdn.heweather.com/cond_icon/300.png "阵雨图标") | 37 | | 301 | 强阵雨 | Heavy Shower Rain | [301.png](https://cdn.heweather.com/cond_icon/301.png "强阵雨图标") | 38 | | 302 | 雷阵雨 | Thundershower | [302.png](https://cdn.heweather.com/cond_icon/302.png "雷阵雨图标") | 39 | | 303 | 强雷阵雨 | Heavy Thunderstorm | [303.png](https://cdn.heweather.com/cond_icon/303.png "强雷阵雨图标") | 40 | | 304 | 雷阵雨伴有冰雹 | Hail | [304.png](https://cdn.heweather.com/cond_icon/304.png "雷阵雨伴有冰雹图标") | 41 | | 305 | 小雨 | Light Rain | [305.png](https://cdn.heweather.com/cond_icon/305.png "小雨图标") | 42 | | 306 | 中雨 | Moderate Rain | [306.png](https://cdn.heweather.com/cond_icon/306.png "中雨图标") | 43 | | 307 | 大雨 | Heavy Rain | [307.png](https://cdn.heweather.com/cond_icon/307.png "大雨图标") | 44 | | 308 | 极端降雨 | Extreme Rain | [308.png](https://cdn.heweather.com/cond_icon/308.png "极端降雨图标") | 45 | | 309 | 毛毛雨/细雨 | Drizzle Rain | [309.png](https://cdn.heweather.com/cond_icon/309.png "毛毛雨图标") | 46 | | 310 | 暴雨 | Storm | [310.png](https://cdn.heweather.com/cond_icon/310.png "暴雨图标") | 47 | | 311 | 大暴雨 | Heavy Storm | [311.png](https://cdn.heweather.com/cond_icon/311.png "大暴雨图标") | 48 | | 312 | 特大暴雨 | Severe Storm | [312.png](https://cdn.heweather.com/cond_icon/312.png "特大暴雨图标") | 49 | | 313 | 冻雨 | Freezing Rain | [313.png](https://cdn.heweather.com/cond_icon/313.png "冻雨图标") | 50 | | 314 | 小到中雨 | Light to moderate rain | [314.png](https://cdn.heweather.com/cond_icon/314.png "小到中雨图标") | 51 | | 315 | 中到大雨 | Moderate to heavy rain | [315.png](https://cdn.heweather.com/cond_icon/315.png "中到大雨图标") | 52 | | 316 | 大到暴雨| Heavy rain to storm | [316.png](https://cdn.heweather.com/cond_icon/316.png "大到暴雨图标") | 53 | | 317 | 暴雨到大暴雨 | Storm to heavy storm | [317.png](https://cdn.heweather.com/cond_icon/317.png "暴雨到大暴雨图标") | 54 | | 318 | 大暴雨到特大暴雨 | Heavy to severe storm | [318.png](https://cdn.heweather.com/cond_icon/318.png "大暴雨到特大暴雨图标") | 55 | | 399 | 雨 | Rain | [399.png](https://cdn.heweather.com/cond_icon/399.png "雨图标") | 56 | | 400 | 小雪 | Light Snow | [400.png](https://cdn.heweather.com/cond_icon/400.png "小雪图标") | 57 | | 401 | 中雪 | Moderate Snow | [401.png](https://cdn.heweather.com/cond_icon/401.png "中雪图标") | 58 | | 402 | 大雪 | Heavy Snow | [402.png](https://cdn.heweather.com/cond_icon/402.png "大雪图标") | 59 | | 403 | 暴雪 | Snowstorm | [403.png](https://cdn.heweather.com/cond_icon/403.png "暴雪图标") | 60 | | 404 | 雨夹雪 | Sleet | [404.png](https://cdn.heweather.com/cond_icon/404.png "雨夹雪图标") | 61 | | 405 | 雨雪天气 | Rain And Snow | [405.png](https://cdn.heweather.com/cond_icon/405.png "雨雪天气图标") | 62 | | 406 | 阵雨夹雪 | Shower Snow | [406.png](https://cdn.heweather.com/cond_icon/406.png "阵雨夹雪图标") | 63 | | 407 | 阵雪 | Snow Flurry | [407.png](https://cdn.heweather.com/cond_icon/407.png "阵雪图标") | 64 | | 408 | 小到中雪 | Light to moderate snow | [408.png](https://cdn.heweather.com/cond_icon/408.png "小到中雪图标") | 65 | | 409 | 中到大雪 | Moderate to heavy snow | [409.png](https://cdn.heweather.com/cond_icon/409.png "中到大雪图标") | 66 | | 410 | 大到暴雪 | Heavy snow to snowstorm | [410.png](https://cdn.heweather.com/cond_icon/410.png "大到暴雪图标") | 67 | | 499 | 雪 | Snows | [499.png](https://cdn.heweather.com/cond_icon/499.png "雪图标") | 68 | | 500 | 薄雾 | Mist | [500.png](https://cdn.heweather.com/cond_icon/500.png "薄雾图标") | 69 | | 501 | 雾 | Foggy | [501.png](https://cdn.heweather.com/cond_icon/501.png "雾图标") | 70 | | 502 | 霾 | Haze | [502.png](https://cdn.heweather.com/cond_icon/502.png "霾图标") | 71 | | 503 | 扬沙 | Sand | [503.png](https://cdn.heweather.com/cond_icon/503.png "扬沙图标") | 72 | | 504 | 浮尘 | Dust | [504.png](https://cdn.heweather.com/cond_icon/504.png "浮尘图标") | 73 | | 507 | 沙尘暴 | Duststorm | [507.png](https://cdn.heweather.com/cond_icon/507.png "沙尘暴图标") | 74 | | 508 | 强沙尘暴 | Sandstorm | [508.png](https://cdn.heweather.com/cond_icon/508.png "强沙尘暴图标") | 75 | | 509 | 浓雾 | Dense fog | [509.png](https://cdn.heweather.com/cond_icon/509.png "浓雾图标") | 76 | | 510 | 强浓雾 | Strong fog | [510.png](https://cdn.heweather.com/cond_icon/510.png "强浓雾图标") | 77 | | 511 | 中度霾 | Moderate haze | [511.png](https://cdn.heweather.com/cond_icon/511.png "中度霾图标") | 78 | | 512 | 重度霾 | Heavy haze | [512.png](https://cdn.heweather.com/cond_icon/512.png "重度霾图标") | 79 | | 513 | 严重霾 | Severe haze | [513.png](https://cdn.heweather.com/cond_icon/513.png "重度霾图标") | 80 | | 514 | 大雾 | Heavy fog | [514.png](https://cdn.heweather.com/cond_icon/514.png "大雾图标") | 81 | | 515 | 特强浓雾 | Extra heavy fog | [515.png](https://cdn.heweather.com/cond_icon/515.png "特强浓雾图标") | 82 | | 900 | 热 | Hot | [900.png](https://cdn.heweather.com/cond_icon/900.png "热图标") | 83 | | 901 | 冷 | Cold | [901.png](https://cdn.heweather.com/cond_icon/901.png "冷图标") | 84 | | 999 | 未知 | Unknown | [999.png](https://cdn.heweather.com/cond_icon/999.png "未知图标") | -------------------------------------------------------------------------------- /bin/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/libeay32.dll -------------------------------------------------------------------------------- /bin/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/douzhongqiang/WeatherSystem/062bb89d2231a86924ac6aae18f7ce3cd1c587f1/bin/ssleay32.dll -------------------------------------------------------------------------------- /bin/styles/DarkStyle.css: -------------------------------------------------------------------------------- 1 | QWidget[NormalWidget='NormalWidget'] 2 | { 3 | background-color: rgb(80, 80, 80); 4 | } 5 | 6 | QWidget[insetWidget='insetWidget'] 7 | { 8 | background: rgb(60, 60, 60); 9 | color: rgb(255, 255, 255); 10 | border: 1px solid red; 11 | border-left-color: rgb(40, 40, 40); 12 | border-top-color: rgb(40, 40, 40); 13 | border-right-color: rgb(200, 200, 200); 14 | border-bottom-color: rgb(200, 200, 200); 15 | border-radius: 4px; 16 | } 17 | 18 | QWidget[ItemWidget='ItemWidget'] 19 | { 20 | background-color: rgb(200, 200, 200); 21 | color: rgb(0, 0, 0); 22 | } 23 | 24 | /*----------------------- QPushButton -------------------------------------------*/ 25 | QPushButton 26 | { 27 | background-color: rgb(100, 100, 100); 28 | color: rgb(255, 255, 255); 29 | border: 2px ridge rgb(80, 80, 80); 30 | border-radius: 4px; 31 | width: 80px; 32 | height: 30px; 33 | } 34 | 35 | QPushButton:pressed 36 | { 37 | background-color: rgb(60, 60, 60); 38 | color: rgb(255, 255, 255); 39 | border: 1px solid rgb(60, 60, 60); 40 | border-left-color: rgb(40, 40, 40); 41 | border-top-color: rgb(40, 40, 40); 42 | border-right-color: rgb(200, 200, 200); 43 | border-bottom-color: rgb(200, 200, 200); 44 | border-radius: 4px; 45 | } 46 | 47 | QPushButton:hover 48 | { 49 | background-color: rgb(120, 120, 120); 50 | } 51 | 52 | QPushButton:disabled 53 | { 54 | background-color: rgb(80, 80, 80); 55 | color: rgb(180, 180, 180); 56 | } 57 | 58 | /*------------------------------------- QLineEdit --------------------------------------*/ 59 | QLineEdit 60 | { 61 | background-color: rgb(60, 60, 60); 62 | color: rgb(255, 255, 255); 63 | border: 1px solid rgb(60, 60, 60); 64 | border-left-color: rgb(40, 40, 40); 65 | border-top-color: rgb(40, 40, 40); 66 | border-right-color: rgb(200, 200, 200); 67 | border-bottom-color: rgb(200, 200, 200); 68 | border-radius: 4px; 69 | min-height: 30px; 70 | } 71 | 72 | /*------------------------------------- QLineEdit --------------------------------------*/ 73 | QProgressBar 74 | { 75 | background-color: rgb(60, 60, 60); 76 | color: rgb(255, 255, 255); 77 | border: 1px solid rgb(60, 60, 60); 78 | border-left-color: rgb(40, 40, 40); 79 | border-top-color: rgb(40, 40, 40); 80 | border-right-color: rgb(200, 200, 200); 81 | border-bottom-color: rgb(200, 200, 200); 82 | border-radius: 4px; 83 | text-align: center; 84 | } 85 | 86 | QProgressBar::chunk 87 | { 88 | background-color: #67A125; 89 | width: 20px; 90 | } 91 | 92 | /*------------------------------------- QLabel --------------------------------------*/ 93 | QLabel 94 | { 95 | color: rgb(255, 255, 255); 96 | } 97 | 98 | /*------------------------------------- QComboBox --------------------------------------*/ 99 | QComboBox 100 | { 101 | background-color: rgb(100, 100, 100); 102 | color: rgb(255, 255, 255); 103 | border: 2px ridge rgb(80, 80, 80); 104 | border-radius: 4px; 105 | height: 30px; 106 | } 107 | 108 | QComboBox:hover 109 | { 110 | background-color: rgb(120, 120, 120); 111 | } 112 | 113 | QComboBox QAbstractItemView 114 | { 115 | border: 2px ridge rgb(80, 80, 80); 116 | background-color: rgb(100, 100, 100); 117 | color: rgb(255, 255, 255); 118 | outline: 0px; 119 | } 120 | 121 | QComboBox QAbstractItemView::item 122 | { 123 | border: 0px solid rgb(100, 100, 100); 124 | background-color: rgb(100, 100, 100); 125 | color: rgb(255, 255, 255); 126 | min-height: 20px; 127 | } 128 | 129 | QComboBox QAbstractItemView::item:hover 130 | { 131 | background-color: rgb(80, 80, 80); 132 | border: 1px ridge rgb(80, 80, 80); 133 | border-left-color: rgb(40, 40, 40); 134 | border-top-color: rgb(40, 40, 40); 135 | border-right-color: rgb(200, 200, 200); 136 | border-bottom-color: rgb(200, 200, 200); 137 | border-radius: 4px; 138 | color: rgb(255, 255, 255); 139 | } 140 | 141 | QComboBox QAbstractItemView::item:selected 142 | { 143 | background-color: rgb(80, 80, 80); 144 | border: 1px ridge rgb(80, 80, 80); 145 | border-left-color: rgb(40, 40, 40); 146 | border-top-color: rgb(40, 40, 40); 147 | border-right-color: rgb(200, 200, 200); 148 | border-bottom-color: rgb(200, 200, 200); 149 | border-radius: 4px; 150 | color: rgb(255, 255, 255); 151 | } 152 | 153 | QComboBox::drop-down 154 | { 155 | width: 20px; 156 | 157 | border-left-width: 1px; 158 | border-left-color: darkgray; 159 | border-left-style: solid; /* just a single line */ 160 | border-top-right-radius: 3px; /* same radius as the QComboBox */ 161 | border-bottom-right-radius: 3px; 162 | background-color: rgb(100, 100, 100); 163 | } 164 | 165 | QComboBox::down-arrow 166 | { 167 | image: url(./Icons/arrow-down.png); 168 | } 169 | 170 | QComboBox::down-arrow:on 171 | { 172 | /* shift the arrow when popup is open */ 173 | background-color: rgb(80, 80, 80); 174 | } 175 | 176 | /*------------------------------------- QToolTip --------------------------------------*/ 177 | QToolTip 178 | { 179 | color: rgb(255, 255, 255); 180 | background-color: rgb(55, 55, 55); 181 | border: 1px solid rgb(100, 100, 100); 182 | } 183 | 184 | /*------------------------------------- QMenu --------------------------------------*/ 185 | QMenu 186 | { 187 | background-color: rgb(100, 100, 100); 188 | color: rgb(255, 255, 255); 189 | border: 1px solid rgb(60, 60, 60); 190 | border-radius: 4px; 191 | margin: 2px; 192 | } 193 | 194 | QMenu::item 195 | { 196 | background-color: rgb(100, 100, 100); 197 | color: rgb(255, 255, 255); 198 | padding: 2px 25px 2px 20px; 199 | } 200 | 201 | QMenu::item:hover, QMenu::item:selected 202 | { 203 | background-color: rgb(80, 80, 80); 204 | border: 1px ridge rgb(80, 80, 80); 205 | border-left-color: rgb(40, 40, 40); 206 | border-top-color: rgb(40, 40, 40); 207 | border-right-color: rgb(200, 200, 200); 208 | border-bottom-color: rgb(200, 200, 200); 209 | border-radius: 4px; 210 | color: rgb(255, 255, 255); 211 | } 212 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "WeatherUI/WeatherMainWindow.h" 3 | #include "WeatherApi/WeatherForecast.h" 4 | #include "WeatherApi/WeatherNow.h" 5 | #include "WeatherApi/WeatherInterface.h" 6 | #include "WeatherApi/WeatherLife.h" 7 | #include "WeatherApi/WeatherAirNow.h" 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QApplication a(argc, argv); 12 | 13 | QFile nFile("./styles/DarkStyle.css"); 14 | if (nFile.open(QFile::ReadOnly)) 15 | { 16 | QString styleSheetString = nFile.readAll().data(); 17 | a.setStyleSheet(styleSheetString); 18 | nFile.close(); 19 | } 20 | 21 | // 刷新当前天气 22 | g_WeatherInterface->updateWeatherInfo(); 23 | 24 | WeatherMainWindow w; 25 | w.resize(1000, 800); 26 | w.show(); 27 | 28 | return a.exec(); 29 | } 30 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Qt实战小工具 -- 日丽天气V1.0 2 | 3 | --- 4 | 5 | 开发环境:**Qt Creator + Qt5.6** 6 | 使用的是**和风天气**的免费API 7 | 8 | 软件具有如下功能: 9 | 10 | - 显示当前城市的天气情况,包括温度、天气、风向及等级、空气质量、生活指数。 11 | - 近三天的天气情况(免费的API只能查看仅三天的天气情况)。 12 | - 可切换当前城市(仅限国内城市),并自动更新城市的天气信息。 13 | - 可手动刷新当前城市的天气信息。 14 | 15 | 16 | --------------------------------------------------------------------------------