From 37b9040e3280c0561559ef66efa3a70faee765ef Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 28 Jul 2023 13:07:21 +0000 Subject: [PATCH] refresh wasn't reachable from ui --- .gitignore | 2 +- src/qml/pages/MainPage.qml | 2 +- src/weathermodel.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7b6194d..be3207a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,5 @@ Makefile installroot/ RPMS/ debug*.list -CMakeLists.txt.user +CMakeLists.txt.user* build/ \ No newline at end of file diff --git a/src/qml/pages/MainPage.qml b/src/qml/pages/MainPage.qml index 548fb30..a139d64 100644 --- a/src/qml/pages/MainPage.qml +++ b/src/qml/pages/MainPage.qml @@ -102,7 +102,7 @@ Page { id: bigForecastIconMouse; anchors.fill: parent onClicked: { - model.refreshWeather() + weatherModel.loadWeatherFromAPI() } } } diff --git a/src/weathermodel.h b/src/weathermodel.h index 6075ce7..8ddbf35 100644 --- a/src/weathermodel.h +++ b/src/weathermodel.h @@ -27,6 +27,8 @@ class WeatherModel : public QAbstractListModel { Q_INVOKABLE QString niceTemperatureString(int temperatureUnits, double t); Q_INVOKABLE double speedConvert(int units, double s); + Q_INVOKABLE void loadWeatherFromAPI(); + signals: void cityChanged(); void hasValidWeatherChanged(); @@ -41,7 +43,6 @@ class WeatherModel : public QAbstractListModel { QSqlDatabase m_db; void loadWeatherFromDB(); - void loadWeatherFromAPI(); }; #endif // WEATHERMODEL_H