Marble
7 #include "KmlColorTagHandler.h"
10 #include "MarbleDebug.h"
11 #include "KmlElementDictionary.h"
12 #include "GeoDataColorStyle.h"
13 #include "GeoDataOverlay.h"
14 #include "GeoParser.h"
20 KML_DEFINE_TAG_HANDLER( color )
22 GeoNode* 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 );
39 QColor 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);
QColor fromRgba(QRgb rgba)
Binds a QML item to a specific geodetic location in screen coordinates.
uint toUInt(bool *ok, int base) const const
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.