Marble

KmlMxSizeTagHandler.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2016 Dennis Nienhüser <[email protected]>
4 //
5 
6 #include "KmlMxSizeTagHandler.h"
7 
8 #include "KmlElementDictionary.h"
9 #include "GeoDataIconStyle.h"
10 #include "GeoParser.h"
11 #include "MarbleDebug.h"
12 
13 namespace Marble
14 {
15 namespace kml
16 {
17 namespace mx
18 {
19 KML_DEFINE_TAG_HANDLER_MX( size )
20 
21 GeoNode* 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.
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.