Marble
7 #include "KmlSimpleFieldTagHandler.h"
9 #include "MarbleDebug.h"
11 #include "KmlElementDictionary.h"
12 #include "GeoDataSchema.h"
14 #include "GeoParser.h"
20 KML_DEFINE_TAG_HANDLER( SimpleField )
22 GeoNode* KmlSimpleFieldTagHandler::parse( GeoParser& parser )
const
24 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1String(kmlTag_SimpleField)));
26 GeoStackItem parentItem = parser.parentElement();
28 if( parentItem.represents( kmlTag_Schema ) ) {
29 GeoDataSimpleField simpleField;
31 QString type = parser.attribute(
"type" ).trimmed();
32 simpleField.setName( name );
33 GeoDataSimpleField::SimpleFieldType fieldType = resolveType( type );
34 simpleField.setType( fieldType );
35 parentItem.nodeAs<GeoDataSchema>()->addSimpleField( simpleField );
36 return &parentItem.nodeAs<GeoDataSchema>()->simpleField( name );
42 GeoDataSimpleField::SimpleFieldType KmlSimpleFieldTagHandler::resolveType(
const QString& type )
44 GeoDataSimpleField::SimpleFieldType fieldType;
46 fieldType = GeoDataSimpleField::String;
49 fieldType = GeoDataSimpleField::Int;
52 fieldType = GeoDataSimpleField::UInt;
55 fieldType = GeoDataSimpleField::Short;
58 fieldType = GeoDataSimpleField::UShort;
61 fieldType = GeoDataSimpleField::Float;
64 fieldType = GeoDataSimpleField::Double;
67 fieldType = GeoDataSimpleField::Bool;
Type type(const QSqlDatabase &db)
QString trimmed() const const
Binds a QML item to a specific geodetic location in screen coordinates.
QString name(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.