Marble
7#include "KmlColorTagHandler.h"
9#include "GeoDataColorStyle.h"
10#include "GeoDataOverlay.h"
12#include "KmlElementDictionary.h"
18KML_DEFINE_TAG_HANDLER(color)
20GeoNode *KmlcolorTagHandler::parse(GeoParser &parser)
const
22 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_color)));
24 GeoStackItem parentItem = parser.parentElement();
26 if (parentItem.is<GeoDataColorStyle>() || parentItem.is<GeoDataOverlay>()) {
27 QColor
const color = parseColor(parser.readElementText().trimmed());
28 if (parentItem.is<GeoDataColorStyle>()) {
29 parentItem.nodeAs<GeoDataColorStyle>()->setColor(color);
30 }
else if (parentItem.is<GeoDataOverlay>()) {
31 parentItem.nodeAs<GeoDataOverlay>()->setColor(color);
37QColor KmlcolorTagHandler::parseColor(
const QString &colorString)
42 QRgb abgr = colorString.
toUInt(&ok, 16);
43 unsigned a = abgr >> 24;
45 unsigned b = abgr >> 24;
47 unsigned g = abgr >> 24;
49 unsigned r = abgr >> 24;
50 QRgb rgba = (a << 24) | (r << 16) | (g << 8) | (b);
Binds a QML item to a specific geodetic location in screen coordinates.
QColor fromRgba(QRgb rgba)
uint toUInt(bool *ok, int base) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Mar 21 2025 11:58:54 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.