Marble

KmlRangeTagHandler.cpp
1#include "KmlRangeTagHandler.h"
2
3#include "KmlElementDictionary.h"
4
5#include "GeoDataCoordinates.h"
6#include "GeoDataLookAt.h"
7#include "GeoParser.h"
8#include "MarbleGlobal.h"
9
10namespace Marble
11{
12namespace kml
13{
14KML_DEFINE_TAG_HANDLER(range)
15GeoNode *KmlrangeTagHandler::parse(GeoParser &parser) const
16{
17 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QString::fromLatin1(kmlTag_range)));
18
19 GeoStackItem parentItem = parser.parentElement();
20
21 if (parentItem.is<GeoDataLookAt>()) {
22 QString rangeTemp = parser.readElementText().trimmed();
23 qreal range = rangeTemp.toDouble();
24
25 parentItem.nodeAs<GeoDataLookAt>()->setRange(range);
26 }
27
28 return nullptr;
29}
30}
31}
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
double toDouble(bool *ok) const const
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.