MauiKit Image Tools

geolocation/city.cpp
1//
2// Created by gabridc on 5/6/21.
3//
4#include "city.h"
5
6City::City(const QString &cityID, const QString &name, const QString &continent, const QString &country, const double &latitude, const double &longitude, QObject *parent) : QObject(parent)
7, m_cityID(cityID)
8, m_name(name)
9, m_continent(continent)
10, m_country(country)
11, m_latitude(latitude)
12, m_longitude(longitude)
13
14{
15
16}
17
18City::City(const City &other, QObject *parent) : QObject(parent)
19, m_cityID(other.id())
20, m_name(other.name())
21, m_continent(other.continent())
22, m_country(other.country())
23, m_latitude(other.latitude())
24, m_longitude(other.longitude())
25
26{
27
28}
29
30
31City::City(QObject* parent) : QObject(parent)
32{
33}
34
35double City::latitude() const
36{
37 return m_latitude;
38}
39
40double City::longitude() const
41{
42 return m_longitude;
43}
44
45QString City::id() const
46{
47 return m_cityID;
48}
49
50QString City::name() const
51{
52 return m_name;
53}
54
55QString City::continent() const
56{
57 return m_continent;
58}
59
60QString City::country() const
61{
62 return m_country;
63}
64
65bool City::isValid() const
66{
67return !m_cityID.isEmpty();
68}
69
70bool City::match(double latitude, double longitude)
71{
72 if(m_latitude == latitude && m_longitude == longitude)
73 {
74 return true;
75 }
76
77 return false;
78}
A class for representing the GPS coordinates and information of a city.
QString name(GameStandardAction id)
QStringView country(QStringView ifopt)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.