Marble

DgmlLegendTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 SPDX-FileCopyrightText: 2008 Torsten Rahn <tackat@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "DgmlLegendTagHandler.h"
9
10#include "MarbleDebug.h"
11
12#include "DgmlElementDictionary.h"
13#include "GeoParser.h"
14#include "GeoSceneDocument.h"
15#include "GeoSceneLegend.h"
16
17namespace Marble
18{
19namespace dgml
20{
21DGML_DEFINE_TAG_HANDLER(Legend)
22
23GeoNode *DgmlLegendTagHandler::parse(GeoParser &parser) const
24{
25 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(dgmlTag_Legend)));
26
27 // Checking for parent item
28 GeoStackItem parentItem = parser.parentElement();
29 if (parentItem.represents(dgmlTag_Document))
30 return parentItem.nodeAs<GeoSceneDocument>()->legend();
31
32 return nullptr;
33}
34
35}
36}
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.