Marble

DgmlSectionTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2011 Utku Aydın <[email protected]>
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 
15 namespace Marble
16 {
17 
18 static GeoTagWriterRegistrar s_writerSection( GeoTagWriter::QualifiedName( GeoSceneTypes::GeoSceneSectionType, dgml::dgmlTag_nameSpace20 ),
19  new DgmlSectionTagWriter() );
20 
21 bool 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 }
QString number(int n, int base)
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.