Marble

DgmlZoomTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2007 Nikolas Zimmermann <zimmermann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "DgmlZoomTagHandler.h"
8
9#include "MarbleDebug.h"
10
11#include "DgmlElementDictionary.h"
12#include "GeoParser.h"
13#include "GeoSceneHead.h"
14#include "GeoSceneZoom.h"
15
16namespace Marble
17{
18namespace dgml
19{
20DGML_DEFINE_TAG_HANDLER(Zoom)
21
22GeoNode *DgmlZoomTagHandler::parse(GeoParser &parser) const
23{
24 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(dgmlTag_Zoom)));
25
26 // Checking for parent item
27 GeoStackItem parentItem = parser.parentElement();
28 if (parentItem.represents(dgmlTag_Head))
29 return parentItem.nodeAs<GeoSceneHead>()->zoom();
30
31 return nullptr;
32}
33
34}
35}
QAction * zoom(const QObject *recvr, const char *slot, QObject *parent)
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.