Marble

DgmlSectionTagWriter.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 "DgmlSectionTagWriter.h"
7
8#include "GeoSceneTypes.h"
9#include "GeoWriter.h"
10#include "GeoSceneSection.h"
11#include "GeoSceneItem.h"
12#include "GeoSceneIcon.h"
13#include "DgmlElementDictionary.h"
14
15namespace Marble
16{
17
18static GeoTagWriterRegistrar s_writerSection( GeoTagWriter::QualifiedName( GeoSceneTypes::GeoSceneSectionType, dgml::dgmlTag_nameSpace20 ),
19 new DgmlSectionTagWriter() );
20
21bool DgmlSectionTagWriter::write(const GeoNode *node, GeoWriter& writer) const
22{
23 const GeoSceneSection *section = static_cast<const GeoSceneSection*>( node );
24
25 writer.writeStartElement( dgml::dgmlTag_Section );
26 writer.writeAttribute( "name", section->name() );
27 writer.writeAttribute( "checkable", section->checkable() ? "true" : "false" );
28 writer.writeAttribute( "connect", section->connectTo() );
29 writer.writeAttribute( "spacing", QString::number( section->spacing() ) );
30 writer.writeElement( dgml::dgmlTag_Heading, section->heading() );
31
32 for( int i = 0; i < section->items().count(); ++i )
33 {
34 GeoSceneItem *item = section->items().at( i );
35 writeElement( item, writer );
36 }
37
38 writer.writeEndElement();
39 return true;
40}
41
42}
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 number(double n, char format, int precision)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.