10 namespace swift::misc::weather
16 qRegisterMetaType<Intensity>();
17 qRegisterMetaType<Descriptor>();
21 : m_intensity(intensity), m_descriptor(descriptor), m_weatherPhenomena(weatherPhenomena)
26 if (index.
isMyself()) {
return QVariant::fromValue(*
this); }
30 case IndexIntensity:
return QVariant::fromValue(m_intensity);
31 case IndexDescriptor:
return QVariant::fromValue(m_descriptor);
32 case IndexWeatherPhenomena:
return QVariant::fromValue(m_weatherPhenomena);
57 { Moderate,
"moderate" },
60 { InVincinity,
"in vincinity" },
64 { None,
"" }, { Shallow,
"shallow" }, { Patches,
"patches" },
65 { Partial,
"partial" }, { Drifting,
"drifting" }, { Blowing,
"blowing" },
66 { Showers,
"showers" }, { Thunderstorm,
"thunderstorm" }, { Freezing,
"freezing" },
72 { SnowGrains,
"snow srains" },
73 { IceCrystals,
"ice crystals" },
74 { IcePellets,
"ice pellets" },
76 { SnowPellets,
"snow pellets" },
77 { Unknown,
"unknown" },
81 { VolcanicAsh,
"volcanic ash" },
85 { DustSandWhirls,
"dustSand whirls" },
86 { Squalls,
"squalls" },
87 { TornadoOrWaterspout,
88 "tornado or waterspout" },
89 { FunnelCloud,
"funnel cloud" },
90 { Sandstorm,
"sandstorm" },
91 { Duststorm,
"duststorm" } };
93 QString weatherPhenomenaAsString;
96 if (m_weatherPhenomena & wp)
98 if (!weatherPhenomenaAsString.isEmpty()) weatherPhenomenaAsString +=
" and ";
99 weatherPhenomenaAsString += weatherPhenomenaHash.value(wp);
104 str += intensityHash.value(m_intensity);
106 str += descriptorHash.value(m_descriptor);
108 str += weatherPhenomenaAsString;
Non-owning reference to a CPropertyIndex with a subset of its features.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
ColumnIndex
Base class enums.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
Value object for present weather flags.
static void registerMetadata()
Register metadata.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QString convertToQString(bool i18n=false) const
Cast as QString.
WeatherPhenomenon
Weather Phenomenon.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
void setIntensity(Intensity intensity)
Set intensity.
void setDescriptor(Descriptor descriptor)
Set descriptor.
CPresentWeather()=default
Default constructor.
void setWeatherPhenomena(int phenomena)
Set weather phenomena.
auto makeKeysRange(const T &container)
Returns a const CRange for iterating over the keys of a Qt associative container.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.