Marble

KmlDisplayNameTagHandler.cpp
1//
2// SPDX-License-Identifier: LGPL-2.1-or-later
3//
4// SPDX-FileCopyrightText: 2010 Harshit Jain <hjain.itbhu@gmail.com>
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
16namespace Marble
17{
18namespace kml
19{
20KML_DEFINE_TAG_HANDLER( displayName )
21
22GeoNode* 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}
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
Binds a QML item to a specific geodetic location in screen coordinates.
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.