KWeatherCore::DailyWeatherForecast

Search for usage in LXR

KWeatherCore::DailyWeatherForecast Class Reference

#include <dailyweatherforecast.h>

Properties

QDateTime date
 
qreal humidity
 
qreal maxTemp
 
qreal minTemp
 
qreal precipitation
 
qreal pressure
 
qreal uvIndex
 
QString weatherDescription
 
QString weatherIcon
 

Public Member Functions

 DailyWeatherForecast ()
 
 DailyWeatherForecast (const DailyWeatherForecast &other)
 
 DailyWeatherForecast (const QDate &date)
 
 DailyWeatherForecast (DailyWeatherForecast &&other) noexcept
 
const QDatedate () const
 
QDateTime dateTime () const
 
const std::vector< HourlyWeatherForecast > & hourlyWeatherForecast () const
 
double humidity () const
 
double maxTemp () const
 
double minTemp () const
 
DailyWeatherForecastoperator+= (HourlyWeatherForecast &&forecast)
 
bool operator< (const DailyWeatherForecast &forecast) const
 
DailyWeatherForecastoperator= (const DailyWeatherForecast &other)
 
DailyWeatherForecastoperator= (DailyWeatherForecast &&other) noexcept
 
bool operator== (const DailyWeatherForecast &forecast) const
 
double precipitation () const
 
double pressure () const
 
void setDate (const QDate &date)
 
void setDate (const QDateTime &date)
 
void setHourlyWeatherForecast (std::vector< HourlyWeatherForecast > &&forecast)
 
void setHumidity (double humidity)
 
void setMaxTemp (double maxTemp)
 
void setMinTemp (double minTemp)
 
void setPrecipitation (double precipitation)
 
void setPressure (double pressure)
 
void setUvIndex (double uvIndex)
 
void setWeatherDescription (const QString &description)
 
void setWeatherIcon (const QString &icon)
 
QJsonObject toJson ()
 
double uvIndex () const
 
const QStringweatherDescription () const
 
const QStringweatherIcon () const
 

Static Public Member Functions

static DailyWeatherForecast fromJson (const QJsonObject &obj)
 

Detailed Description

Class represents weatherforecast in a day.

This is a class to hold general weather conditions and hourly forecast in a day All QDate/DateTime are on the location's timezone

See also
HourlyForecast
Author
Han Young hanyo.nosp@m.ung@.nosp@m.proto.nosp@m.nmai.nosp@m.l.com

Definition at line 24 of file dailyweatherforecast.h.

Property Documentation

◆ date

QDateTime KWeatherCore::DailyWeatherForecast::date
readwrite

Definition at line 35 of file dailyweatherforecast.h.

◆ humidity

qreal KWeatherCore::DailyWeatherForecast::humidity
readwrite

Definition at line 31 of file dailyweatherforecast.h.

◆ maxTemp

qreal KWeatherCore::DailyWeatherForecast::maxTemp
readwrite

Definition at line 27 of file dailyweatherforecast.h.

◆ minTemp

qreal KWeatherCore::DailyWeatherForecast::minTemp
readwrite

Definition at line 28 of file dailyweatherforecast.h.

◆ precipitation

qreal KWeatherCore::DailyWeatherForecast::precipitation
readwrite

Definition at line 29 of file dailyweatherforecast.h.

◆ pressure

qreal KWeatherCore::DailyWeatherForecast::pressure
readwrite

Definition at line 32 of file dailyweatherforecast.h.

◆ uvIndex

qreal KWeatherCore::DailyWeatherForecast::uvIndex
readwrite

Definition at line 30 of file dailyweatherforecast.h.

◆ weatherDescription

QString KWeatherCore::DailyWeatherForecast::weatherDescription
readwrite

Definition at line 34 of file dailyweatherforecast.h.

◆ weatherIcon

QString KWeatherCore::DailyWeatherForecast::weatherIcon
readwrite

Definition at line 33 of file dailyweatherforecast.h.

Constructor & Destructor Documentation

◆ DailyWeatherForecast() [1/3]

KWeatherCore::DailyWeatherForecast::DailyWeatherForecast ( )

Creates a invalid DailyWeatherForecast.

Definition at line 31 of file dailyweatherforecast.cpp.

◆ DailyWeatherForecast() [2/3]

KWeatherCore::DailyWeatherForecast::DailyWeatherForecast ( const QDate & date)
explicit

Definition at line 35 of file dailyweatherforecast.cpp.

◆ DailyWeatherForecast() [3/3]

KWeatherCore::DailyWeatherForecast::DailyWeatherForecast ( const DailyWeatherForecast & other)

Definition at line 40 of file dailyweatherforecast.cpp.

Member Function Documentation

◆ date()

const QDate & KWeatherCore::DailyWeatherForecast::date ( ) const

return date this object represents

Returns
date, date can be invalid if constructed without data

Definition at line 156 of file dailyweatherforecast.cpp.

◆ dateTime()

QDateTime KWeatherCore::DailyWeatherForecast::dateTime ( ) const

Definition at line 160 of file dailyweatherforecast.cpp.

◆ fromJson()

DailyWeatherForecast KWeatherCore::DailyWeatherForecast::fromJson ( const QJsonObject & obj)
static

Construct a DailyWeatherForecast from QJsonObject.

Definition at line 65 of file dailyweatherforecast.cpp.

◆ hourlyWeatherForecast()

const std::vector< HourlyWeatherForecast > & KWeatherCore::DailyWeatherForecast::hourlyWeatherForecast ( ) const

returns all HourlyWeathreForecast belonged to this day

Returns
all HourlyWeathreForecast belonged to this day

Definition at line 164 of file dailyweatherforecast.cpp.

◆ humidity()

double KWeatherCore::DailyWeatherForecast::humidity ( ) const

return humidity

Returns
this value is initialized to zero

Definition at line 140 of file dailyweatherforecast.cpp.

◆ maxTemp()

double KWeatherCore::DailyWeatherForecast::maxTemp ( ) const

return maximum temperature

Returns
maximum temperature, this value is initialized to the smallest value double can hold

Definition at line 124 of file dailyweatherforecast.cpp.

◆ minTemp()

double KWeatherCore::DailyWeatherForecast::minTemp ( ) const

return minimum temperature

Returns
minimum temperature, this value is initialized to the largest value double can hold

Definition at line 128 of file dailyweatherforecast.cpp.

◆ operator+=()

DailyWeatherForecast & KWeatherCore::DailyWeatherForecast::operator+= ( HourlyWeatherForecast && forecast)

append hourly forecast, you can append valid hourly forecast into a invalid daily forecast, daily forecast becomes valid afterwards

Parameters
forecastmake sure it's on the same day
Returns
result DailyWeatherForecast

Definition at line 173 of file dailyweatherforecast.cpp.

◆ operator<()

bool KWeatherCore::DailyWeatherForecast::operator< ( const DailyWeatherForecast & forecast) const

if this is earlier than

Parameters
forecast
forecast
Returns
true if this is earlier than
Parameters
forecast

Definition at line 204 of file dailyweatherforecast.cpp.

◆ operator=()

DailyWeatherForecast & KWeatherCore::DailyWeatherForecast::operator= ( const DailyWeatherForecast & other)

Definition at line 208 of file dailyweatherforecast.cpp.

◆ operator==()

bool KWeatherCore::DailyWeatherForecast::operator== ( const DailyWeatherForecast & forecast) const

if on the same day

Parameters
forecast
Returns
true if on the same day

Definition at line 199 of file dailyweatherforecast.cpp.

◆ precipitation()

double KWeatherCore::DailyWeatherForecast::precipitation ( ) const

return precipitation

Returns
this value is initialized to zero

Definition at line 132 of file dailyweatherforecast.cpp.

◆ pressure()

double KWeatherCore::DailyWeatherForecast::pressure ( ) const

return pressure

Returns
this value is initialized to zero

Definition at line 144 of file dailyweatherforecast.cpp.

◆ setDate() [1/2]

void KWeatherCore::DailyWeatherForecast::setDate ( const QDate & date)

set the date this object represents

Parameters
date

Definition at line 116 of file dailyweatherforecast.cpp.

◆ setDate() [2/2]

void KWeatherCore::DailyWeatherForecast::setDate ( const QDateTime & date)

Definition at line 120 of file dailyweatherforecast.cpp.

◆ setHourlyWeatherForecast()

void KWeatherCore::DailyWeatherForecast::setHourlyWeatherForecast ( std::vector< HourlyWeatherForecast > && forecast)

overloaded version

Parameters
forecast

Definition at line 168 of file dailyweatherforecast.cpp.

◆ setHumidity()

void KWeatherCore::DailyWeatherForecast::setHumidity ( double humidity)

set the humidity of the day

Parameters
humidityhumidity of the day, in percentage

Definition at line 100 of file dailyweatherforecast.cpp.

◆ setMaxTemp()

void KWeatherCore::DailyWeatherForecast::setMaxTemp ( double maxTemp)

set the maximum temperature of the day

Parameters
maxTempmaximum temperature of the day, in celsius

Definition at line 84 of file dailyweatherforecast.cpp.

◆ setMinTemp()

void KWeatherCore::DailyWeatherForecast::setMinTemp ( double minTemp)

set the minimum temperature of the day

Parameters
minTempminimum temperature of the day, in celsius

Definition at line 88 of file dailyweatherforecast.cpp.

◆ setPrecipitation()

void KWeatherCore::DailyWeatherForecast::setPrecipitation ( double precipitation)

set the precipitation of the day

Parameters
precipitationprecipitation of the day, in mm

Definition at line 92 of file dailyweatherforecast.cpp.

◆ setPressure()

void KWeatherCore::DailyWeatherForecast::setPressure ( double pressure)

set the pressure of the day

Parameters
pressurepressure of the day, in hpa

Definition at line 104 of file dailyweatherforecast.cpp.

◆ setUvIndex()

void KWeatherCore::DailyWeatherForecast::setUvIndex ( double uvIndex)

set the UvIndex of the day

Parameters
uvIndex0-1

Definition at line 96 of file dailyweatherforecast.cpp.

◆ setWeatherDescription()

void KWeatherCore::DailyWeatherForecast::setWeatherDescription ( const QString & description)

set the weather description of the day

Parameters
description

Definition at line 112 of file dailyweatherforecast.cpp.

◆ setWeatherIcon()

void KWeatherCore::DailyWeatherForecast::setWeatherIcon ( const QString & icon)

set the weather icon of the day

Parameters
icon

Definition at line 108 of file dailyweatherforecast.cpp.

◆ toJson()

QJsonObject KWeatherCore::DailyWeatherForecast::toJson ( )

Return a QJsonObject that can be converted back with DailyWeatherForecast::fromJson.

Definition at line 46 of file dailyweatherforecast.cpp.

◆ uvIndex()

double KWeatherCore::DailyWeatherForecast::uvIndex ( ) const

return uvIndex

Returns
this value is initialized to zero

Definition at line 136 of file dailyweatherforecast.cpp.

◆ weatherDescription()

const QString & KWeatherCore::DailyWeatherForecast::weatherDescription ( ) const

return weather description

Returns
weather description, can be empty string if constructed without data

Definition at line 152 of file dailyweatherforecast.cpp.

◆ weatherIcon()

const QString & KWeatherCore::DailyWeatherForecast::weatherIcon ( ) const

return weather icon

Returns
weather icon, can be empty string if constructed without data

Definition at line 148 of file dailyweatherforecast.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.