Marble

KmlMxSizeTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2016 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#include "KmlMxSizeTagHandler.h"
7
8#include "GeoDataIconStyle.h"
9#include "GeoParser.h"
10#include "KmlElementDictionary.h"
11#include "MarbleDebug.h"
12
13namespace Marble
14{
15namespace kml
16{
17namespace mx
18{
19KML_DEFINE_TAG_HANDLER_MX(size)
20
21GeoNode *KmlsizeTagHandler::parse(GeoParser &parser) const
22{
23 if (parser.parentElement().is<GeoDataIconStyle>()) {
24 auto const width = parser.attribute(kmlTag_width).toInt();
25 auto const height = parser.attribute(kmlTag_height).toInt();
26 auto const size = QSize(width, height);
27 if (size.isEmpty()) {
28 mDebug() << "Invalid size in icon style: width=" << width << ", height=" << height;
29 } else {
30 parser.parentElement().nodeAs<GeoDataIconStyle>()->setSize(size);
31 }
32 }
33
34 return nullptr;
35}
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 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.