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 "GeoDataData.h"
10#include "GeoDataSimpleField.h"
11#include "GeoParser.h"
12#include "KmlElementDictionary.h"
13
14namespace Marble
15{
16namespace kml
17{
18KML_DEFINE_TAG_HANDLER(displayName)
19
20GeoNode *KmldisplayNameTagHandler::parse(GeoParser &parser) const
21{
22 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_displayName)));
23
24 GeoStackItem parentItem = parser.parentElement();
25
26 if (parentItem.represents(kmlTag_Data)) {
27 QString displayName = parser.readElementText().trimmed();
28 parentItem.nodeAs<GeoDataData>()->setDisplayName(displayName);
29 } else if (parentItem.represents(kmlTag_SimpleField)) {
30 QString displayName = parser.readElementText().trimmed();
31 parentItem.nodeAs<GeoDataSimpleField>()->setDisplayName(displayName);
32 }
33 return nullptr;
34}
35
36}
37}
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 Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.