Marble

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

KDE's Doxygen guidelines are available online.