Marble

GeoDataData.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Harshit Jain <[email protected]>
4 //
5 
6 #include "GeoDataData.h"
7 #include "GeoDataData_p.h"
8 
9 #include <QDataStream>
10 
11 #include "GeoDataTypes.h"
12 #include "osm/OsmPlacemarkData.h"
13 
14 namespace Marble
15 {
16 
17 GeoDataData::GeoDataData()
18  : GeoDataObject(), d( new GeoDataDataPrivate )
19 {
20 }
21 
22 GeoDataData::GeoDataData( const GeoDataData& other )
23  : GeoDataObject( other ), d( new GeoDataDataPrivate( *other.d ) )
24 {
25 }
26 
27 GeoDataData::~GeoDataData()
28 {
29  delete d;
30 }
31 
32 GeoDataData& GeoDataData::operator=( const GeoDataData& other )
33 {
34  GeoDataObject::operator=( other );
35  *d = *other.d;
36  return *this;
37 }
38 
39 bool GeoDataData::operator==( const GeoDataData& other) const
40 {
41  return equals(other) &&
42  d->m_name == other.d->m_name &&
43  d->m_value == other.d->m_value &&
44  d->m_displayName == other.d->m_displayName;
45 }
46 
47 bool GeoDataData::operator!=( const GeoDataData &other ) const
48 {
49  return !this->operator==(other);
50 }
51 
52 GeoDataData::GeoDataData( const QString &name, const QVariant &value )
53  : d( new GeoDataDataPrivate )
54 {
55  d->m_name = name;
56  d->m_value = value;
57 }
58 
59 const char* GeoDataData::nodeType() const
60 {
61  return GeoDataTypes::GeoDataDataType;
62 }
63 
64 QVariant GeoDataData::value() const
65 {
66  return d->m_value;
67 }
68 
69 QVariant& GeoDataData::valueRef()
70 {
71  return d->m_value;
72 }
73 
74 const QVariant& GeoDataData::valueRef() const
75 {
76  return d->m_value;
77 }
78 
79 void GeoDataData::setValue( const QVariant& value )
80 {
81  d->m_value = value;
82 }
83 
84 QString GeoDataData::name() const
85 {
86  return d->m_name;
87 }
88 
89 void GeoDataData::setName( const QString& name )
90 {
91  d->m_name = name;
92 }
93 
94 QString GeoDataData::displayName() const
95 {
96  return d->m_displayName;
97 }
98 
99 void GeoDataData::setDisplayName( const QString& displayName )
100 {
101  d->m_displayName = displayName;
102 }
103 
104 void GeoDataData::pack( QDataStream& stream ) const
105 {
106  GeoDataObject::pack( stream );
107 
108  stream << d->m_value;
109  stream << d->m_displayName;
110 }
111 
112 void GeoDataData::unpack( QDataStream& stream )
113 {
114  GeoDataObject::unpack( stream );
115 
116  stream >> d->m_value;
117  stream >> d->m_displayName;
118 }
119 
120 }
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
void pack(QDataStream &stream) const override
Reimplemented from Serializable.
Binds a QML item to a specific geodetic location in screen coordinates.
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
QString name(StandardShortcut id)
void unpack(QDataStream &steam) override
Reimplemented from Serializable.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.