Marble

KmlDisplayNameTagHandler.cpp
1 //
2 // SPDX-License-Identifier: LGPL-2.1-or-later
3 //
4 // SPDX-FileCopyrightText: 2010 Harshit Jain <[email protected]>
5 //
6 
7 #include "KmlDisplayNameTagHandler.h"
8 
9 #include "MarbleDebug.h"
10 
11 #include "KmlElementDictionary.h"
12 #include "GeoDataData.h"
13 #include "GeoDataSimpleField.h"
14 #include "GeoParser.h"
15 
16 namespace Marble
17 {
18 namespace kml
19 {
20 KML_DEFINE_TAG_HANDLER( displayName )
21 
22 GeoNode* KmldisplayNameTagHandler::parse( GeoParser& parser ) const
23 {
24  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_displayName)));
25 
26  GeoStackItem parentItem = parser.parentElement();
27 
28  if ( parentItem.represents( kmlTag_Data ) ) {
29  QString displayName = parser.readElementText().trimmed();
30  parentItem.nodeAs<GeoDataData>()->setDisplayName( displayName );
31  }
32  else if ( parentItem.represents( kmlTag_SimpleField ) ) {
33  QString displayName = parser.readElementText().trimmed();
34  parentItem.nodeAs<GeoDataSimpleField>()->setDisplayName( displayName );
35  }
36  return nullptr;
37 }
38 
39 }
40 }
QString trimmed() const const
Binds a QML item to a specific geodetic location in screen coordinates.
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.