Marble

DgmlHeadingTagHandler.cpp
1 /*
2  SPDX-FileCopyrightText: 2007, 2008 Nikolas Zimmermann <[email protected]>
3  SPDX-FileCopyrightText: 2008 Torsten Rahn <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #include "DgmlHeadingTagHandler.h"
9 
10 #include "DgmlElementDictionary.h"
11 #include "GeoParser.h"
12 #include "GeoSceneSection.h"
13 
14 namespace Marble
15 {
16 namespace dgml
17 {
18 DGML_DEFINE_TAG_HANDLER(Heading)
19 
20 GeoNode* DgmlHeadingTagHandler::parse(GeoParser& parser) const
21 {
22  // Check whether the tag is valid
23  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(dgmlTag_Heading)));
24 
25  // Checking for parent item
26  GeoStackItem parentItem = parser.parentElement();
27  if (parentItem.represents(dgmlTag_Section))
28  parentItem.nodeAs<GeoSceneSection>()->setHeading(parser.readElementText().trimmed());
29 
30  return nullptr;
31 }
32 
33 }
34 }
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.