File indexing completed on 2024-05-12 04:43:58

0001 /*
0002  * SPDX-FileCopyrightText: 2020-2021 Han Young <hanyoung@protonmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #include <KWeatherCore/WeatherForecastSource>
0007 using namespace KWeatherCore;
0008 
0009 //...
0010 
0011 // Get the weatherforecast of Paris
0012 WeatherForecastSource m_source;
0013 
0014 auto m_pendingForecast = m_source.requestData(48.86, 2.34);
0015 
0016 connect(m_pendingForecast, &PendingWeatherForecast::finished, [m_pendingForecast] {
0017     auto m_weatherData = m_pendingForecast->value();
0018     m_pendingForecast->deleteLater();
0019 });
0020 connect(m_pendingForecast, &PendingWeatherForecast::networkError, [] {
0021     qDebug() << "network error";
0022 });
0023 
0024 //...