1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
/*
* SPDX-FileCopyrightText: 2020-2021 Han Young <hanyoung@protonmail.com>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include <KWeatherCore/WeatherForecastSource>
using namespace KWeatherCore;
//...
// Get the weatherforecast of Paris
WeatherForecastSource m_source;
auto m_pendingForecast = m_source.requestData(48.86, 2.34);
connect(m_pendingForecast, &PendingWeatherForecast::finished, [m_pendingForecast] {
auto m_weatherData = m_pendingForecast->value();
m_pendingForecast->deleteLater();
});
connect(m_pendingForecast, &PendingWeatherForecast::networkError, [] {
qDebug() << "network error";
});
//...
|