7#include "KmlColorTagHandler.h"
10#include "MarbleDebug.h"
11#include "KmlElementDictionary.h"
12#include "GeoDataColorStyle.h"
13#include "GeoDataOverlay.h"
20KML_DEFINE_TAG_HANDLER( color )
22GeoNode* KmlcolorTagHandler::parse( GeoParser& parser )
const
24 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1String(kmlTag_color)));
26 GeoStackItem parentItem = parser.parentElement();
28 if ( parentItem.is<GeoDataColorStyle>() || parentItem.is<GeoDataOverlay>() ) {
29 QColor const color = parseColor( parser.readElementText().trimmed() );
30 if ( parentItem.is<GeoDataColorStyle>() ) {
31 parentItem.nodeAs<GeoDataColorStyle>()->setColor( color );
32 }
else if ( parentItem.is<GeoDataOverlay>() ) {
33 parentItem.nodeAs<GeoDataOverlay>()->setColor( color );
39QColor KmlcolorTagHandler::parseColor(
const QString &colorString )
44 QRgb abgr = colorString.
toUInt( &ok, 16 );
45 unsigned a = abgr >> 24; abgr = abgr << 8;
46 unsigned b = abgr >> 24; abgr = abgr << 8;
47 unsigned g = abgr >> 24; abgr = abgr << 8;
48 unsigned r = abgr >> 24;
49 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-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:57:57 by
doxygen 1.11.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.