Marble

KmlDurationTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4//
5#include "KmlDurationTagHandler.h"
6
7#include "MarbleDebug.h"
8
9#include "KmlElementDictionary.h"
10
11#include "MarbleGlobal.h"
12#include "GeoDataFlyTo.h"
13#include "GeoDataWait.h"
14#include "GeoDataAnimatedUpdate.h"
15#include "GeoParser.h"
16
17
18namespace Marble
19{
20namespace kml
21{
22
23KML_DEFINE_TAG_HANDLER_GX22( duration )
24
25GeoNode *KmldurationTagHandler::parse(GeoParser & parser) const
26{
27 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_duration)));
28
29 GeoStackItem parentItem = parser.parentElement();
30
31 qreal const duration = parser.readElementText().trimmed().toDouble();
32 if ( parentItem.is<GeoDataFlyTo>() ){
33 parentItem.nodeAs<GeoDataFlyTo>()->setDuration( duration );
34 }
35 if ( parentItem.is<GeoDataWait>() ){
36 parentItem.nodeAs<GeoDataWait>()->setDuration( duration );
37 }
38 if ( parentItem.is<GeoDataAnimatedUpdate>() ){
39 parentItem.nodeAs<GeoDataAnimatedUpdate>()->setDuration( duration );
40 }
41 return nullptr;
42}
43
44}
45}
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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.