Marble

GeoDataStyleMap.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
4//
5
6
7#include "GeoDataStyleMap.h"
8#include <QDataStream>
9
10#include "GeoDataTypes.h"
11
12namespace Marble
13{
14
15class GeoDataStyleMapPrivate
16{
17 public:
18 QString lastKey;
19};
20
21
22GeoDataStyleMap::GeoDataStyleMap()
23 : d( new GeoDataStyleMapPrivate )
24{
25}
26
27GeoDataStyleMap::GeoDataStyleMap( const GeoDataStyleMap& other )
28 : GeoDataStyleSelector( other ) , QMap<QString,QString>(other), d( new GeoDataStyleMapPrivate( *other.d ) )
29
30{
31}
32
33GeoDataStyleMap::~GeoDataStyleMap()
34{
35 delete d;
36}
37
38const char* GeoDataStyleMap::nodeType() const
39{
40 return GeoDataTypes::GeoDataStyleMapType;
41}
42
43QString GeoDataStyleMap::lastKey() const
44{
45 return d->lastKey;
46}
47
48void GeoDataStyleMap::setLastKey( const QString& key )
49{
50 d->lastKey = key;
51}
52
53GeoDataStyleMap& GeoDataStyleMap::operator=( const GeoDataStyleMap& other )
54{
56 GeoDataStyleSelector::operator=( other );
57 *d = *other.d;
58 return *this;
59}
60
61bool GeoDataStyleMap::operator==( const GeoDataStyleMap &other ) const
62{
63 if ( GeoDataStyleSelector::operator!=( other ) ||
65 {
66 return false;
67 }
68
69 return d->lastKey == other.d->lastKey;
70}
71
72bool GeoDataStyleMap::operator!=( const GeoDataStyleMap &other ) const
73{
74 return !this->operator==( other );
75}
76
77void GeoDataStyleMap::pack( QDataStream& stream ) const
78{
79 GeoDataStyleSelector::pack( stream );
80 // lastKey doesn't need to be stored as it is needed at runtime only
81 stream << *this;
82}
83
84void GeoDataStyleMap::unpack( QDataStream& stream )
85{
86 GeoDataStyleSelector::unpack( stream );
87
88 stream >> *this;
89}
90
91}
a class to map different styles to one style
Binds a QML item to a specific geodetic location in screen coordinates.
QMap< Key, T > & operator=(QMap< Key, T > &&other)
bool operator==(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.