Marble

Kml_scaleTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
8// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
9// to mark the lower case variant
10
11#include "Kml_scaleTagHandler.h"
12
13#include "GeoDataIconStyle.h"
14#include "GeoDataLabelStyle.h"
15#include "GeoParser.h"
16#include "KmlElementDictionary.h"
17
18namespace Marble
19{
20namespace kml
21{
22KML_DEFINE_TAG_HANDLER(scale)
23
24GeoNode *KmlscaleTagHandler::parse(GeoParser &parser) const
25{
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_scale)));
27
28 GeoStackItem parentItem = parser.parentElement();
29
30 if (parentItem.represents(kmlTag_IconStyle)) {
31 parentItem.nodeAs<GeoDataIconStyle>()->setScale(parser.readElementText().trimmed().toFloat());
32 } else if (parentItem.represents(kmlTag_LabelStyle)) {
33 parentItem.nodeAs<GeoDataLabelStyle>()->setScale(parser.readElementText().trimmed().toFloat());
34 }
35 return nullptr;
36}
37
38}
39}
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 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.