Marble

DgmlLegendTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Utku Aydın <utkuaydin34@gmail.com>
4//
5
6#include "DgmlLegendTagWriter.h"
7
8#include "DgmlElementDictionary.h"
9#include "GeoSceneLegend.h"
10#include "GeoSceneSection.h"
11#include "GeoSceneTypes.h"
12#include "GeoWriter.h"
13
14namespace Marble
15{
16
17static GeoTagWriterRegistrar s_writerLegend(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoSceneTypes::GeoSceneLegendType),
18 QString::fromLatin1(dgml::dgmlTag_nameSpace20)),
19 new DgmlLegendTagWriter());
20
21bool DgmlLegendTagWriter::write(const GeoNode *node, GeoWriter &writer) const
22{
23 const auto legend = static_cast<const GeoSceneLegend *>(node);
24
25 writer.writeStartElement(QString::fromUtf8(dgml::dgmlTag_Legend));
26 for (int i = 0; i < legend->sections().count(); ++i) {
27 const GeoSceneSection *section = legend->sections().at(i);
28 writeElement(section, writer);
29 }
30 writer.writeEndElement();
31 return true;
32}
33
34}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:51:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.