8#include "DgmlIconTagHandler.h"
14#include "DgmlAttributeDictionary.h"
15#include "DgmlElementDictionary.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(
QLatin1StringView(dgmlTag_Icon)));
32 QString pixmapRelativePath = parser.attribute(dgmlAttr_pixmap).
trimmed();
34 QColor color(parser.attribute(dgmlAttr_color).trimmed());
36 GeoSceneIcon *icon =
nullptr;
39 GeoStackItem parentItem = parser.parentElement();
40 if (parentItem.represents(dgmlTag_Head)) {
41 icon = parentItem.nodeAs<GeoSceneHead>()->icon();
42 icon->setPixmap(pixmapRelativePath);
43 icon->setColor(color);
45 if (parentItem.represents(dgmlTag_Item)) {
46 icon = parentItem.nodeAs<GeoSceneItem>()->icon();
47 icon->setPixmap(pixmapRelativePath);
48 icon->setColor(color);
Binds a QML item to a specific geodetic location in screen coordinates.
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:08:53 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.