Marble

GeoDataSimpleField.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2014 Abhinav Gangwar <[email protected]>
4 //
5 
6 #include "GeoDataSimpleField.h"
7 
8 // Qt
9 #include <QDataStream>
10 #include <QString>
11 
12 // Marble
13 #include "GeoDataTypes.h"
14 
15 
16 namespace Marble
17 {
18 
19 class GeoDataSimpleFieldPrivate
20 {
21  public:
22  QString m_name;
23  GeoDataSimpleField::SimpleFieldType m_type;
24  QString m_displayName;
25 };
26 
27 GeoDataSimpleField::GeoDataSimpleField()
28  : GeoNode(),
29  d( new GeoDataSimpleFieldPrivate )
30 {
31 }
32 
33 GeoDataSimpleField::GeoDataSimpleField( const GeoDataSimpleField& other )
34  : GeoNode(),
35  d( new GeoDataSimpleFieldPrivate( *other.d ) )
36 {
37 }
38 
39 bool GeoDataSimpleField::operator==(const GeoDataSimpleField& other) const
40 {
41  return d->m_name == other.d->m_name &&
42  d->m_type == other.d->m_type &&
43  d->m_displayName == other.d->m_displayName;
44 }
45 
46 bool GeoDataSimpleField::operator!=(const GeoDataSimpleField& other) const
47 {
48  return !this->operator==( other );
49 }
50 
51 GeoDataSimpleField::~GeoDataSimpleField()
52 {
53  delete d;
54 }
55 
56 GeoDataSimpleField::SimpleFieldType GeoDataSimpleField::type() const
57 {
58  return d->m_type;
59 }
60 
61 void GeoDataSimpleField::setType(SimpleFieldType type)
62 {
63  d->m_type = type;
64 }
65 
66 QString GeoDataSimpleField::name() const
67 {
68  return d->m_name;
69 }
70 
71 void GeoDataSimpleField::setName( const QString& value )
72 {
73  d->m_name = value;
74 }
75 
76 QString GeoDataSimpleField::displayName() const
77 {
78  return d->m_displayName;
79 }
80 
81 void GeoDataSimpleField::setDisplayName( const QString& displayName )
82 {
83  d->m_displayName = displayName;
84 }
85 
86 GeoDataSimpleField& GeoDataSimpleField::operator=( const GeoDataSimpleField& other )
87 {
88  *d = *other.d;
89  return *this;
90 }
91 
92 const char* GeoDataSimpleField::nodeType() const
93 {
94  return GeoDataTypes::GeoDataSimpleFieldType;
95 }
96 
97 void GeoDataSimpleField::pack( QDataStream& stream ) const
98 {
99  stream << d->m_name;
100  stream << d->m_displayName;
101 }
102 
103 void GeoDataSimpleField::unpack( QDataStream& stream )
104 {
105  stream >> d->m_name;
106  stream >> d->m_displayName;
107 }
108 
109 
110 }
Type type(const QSqlDatabase &db)
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Binds a QML item to a specific geodetic location in screen coordinates.
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Oct 3 2023 04:09:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.