Marble

DgmlSettingsTagHandler.cpp
1 /*
2  SPDX-FileCopyrightText: 2007 Nikolas Zimmermann <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "DgmlSettingsTagHandler.h"
8 
9 #include "MarbleDebug.h"
10 
11 #include "DgmlElementDictionary.h"
12 #include "GeoParser.h"
13 #include "GeoSceneDocument.h"
14 #include "GeoSceneSettings.h"
15 
16 namespace Marble
17 {
18 namespace dgml
19 {
20 DGML_DEFINE_TAG_HANDLER(Settings)
21 
22 GeoNode* DgmlSettingsTagHandler::parse(GeoParser& parser) const
23 {
24  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(dgmlTag_Settings)));
25 
26  // Checking for parent item
27  GeoStackItem parentItem = parser.parentElement();
28  if (parentItem.represents(dgmlTag_Document))
29  return parentItem.nodeAs<GeoSceneDocument>()->settings();
30 
31  return nullptr;
32 }
33 
34 }
35 }
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 Sep 25 2023 03:50:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.