Marble

DgmlValueTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Nikolas Zimmermann <zimmermann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "DgmlValueTagHandler.h"
8
9#include "MarbleDebug.h"
10
11#include "DgmlElementDictionary.h"
12#include "DgmlAuxillaryDictionary.h"
13#include "GeoParser.h"
14#include "GeoSceneProperty.h"
15
16namespace Marble
17{
18namespace dgml
19{
20DGML_DEFINE_TAG_HANDLER(Value)
21
22GeoNode* DgmlValueTagHandler::parse(GeoParser& parser) const
23{
24 // Check whether the tag is valid
25 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(dgmlTag_Value)));
26
27 // Checking for parent item
28 GeoStackItem parentItem = parser.parentElement();
29 if (parentItem.represents(dgmlTag_Property)) {
30 QString parsedText = parser.readElementText().toLower().trimmed();
31 parentItem.nodeAs<GeoSceneProperty>()->setDefaultValue(parsedText == dgmlValue_true || parsedText == dgmlValue_on);
32 }
33
34 return nullptr;
35}
36
37}
38}
Binds a QML item to a specific geodetic location in screen coordinates.
QString toLower() const const
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.