Marble
8#include "DgmlIconTagHandler.h"
14#include "DgmlElementDictionary.h"
15#include "DgmlAttributeDictionary.h"
17#include "GeoSceneHead.h"
18#include "GeoSceneIcon.h"
19#include "GeoSceneItem.h"
25DGML_DEFINE_TAG_HANDLER(
Icon)
27GeoNode* DgmlIconTagHandler::parse(GeoParser& parser)
const
30 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1String(dgmlTag_Icon)));
32 QString pixmapRelativePath = parser.attribute(dgmlAttr_pixmap).
trimmed();
35 color.
setNamedColor(parser.attribute(dgmlAttr_color).trimmed());
37 GeoSceneIcon *icon =
nullptr;
40 GeoStackItem parentItem = parser.parentElement();
41 if (parentItem.represents(dgmlTag_Head)) {
42 icon = parentItem.nodeAs<GeoSceneHead>()->icon();
43 icon->setPixmap( pixmapRelativePath );
44 icon->setColor( color );
46 if (parentItem.represents(dgmlTag_Item)) {
47 icon = parentItem.nodeAs<GeoSceneItem>()->icon();
48 icon->setPixmap( pixmapRelativePath );
49 icon->setColor( color );
Binds a QML item to a specific geodetic location in screen coordinates.
void setNamedColor(QLatin1StringView name)
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:07 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.