40 QDomNode lvalnode = synode.namedItem(
"lowervalue" );
41 if ( ! lvalnode.isNull() )
43 QDomElement lvalelement = lvalnode.toElement();
44 if ( lvalelement.attribute(
"null" ).toInt() == 1 )
54 QDomNode uvalnode = synode.namedItem(
"uppervalue" );
55 if ( ! uvalnode.isNull() )
57 QDomElement uvalelement = uvalnode.toElement();
61 QDomNode labelnode = synode.namedItem(
"label" );
62 if ( ! labelnode.isNull() )
64 QDomElement labelelement = labelnode.toElement();
65 meta.
label = labelelement.text();
74 QDomNode cnode = synode.namedItem( fillColor ?
"fillcolor" :
"outlinecolor" );
75 QDomElement celement = cnode.toElement();
76 int red = celement.attribute(
"red" ).toInt();
77 int green = celement.attribute(
"green" ).toInt();
78 int blue = celement.attribute(
"blue" ).toInt();
79 return QColor( red, green, blue );
84 QDomNode outlwnode = synode.namedItem(
"outlinewidth" );
85 QDomElement outlwelement = outlwnode.toElement();
86 return outlwelement.text().toDouble();
92 QDomNode outlstnode = synode.namedItem(
"outlinestyle" );
93 QDomElement outlstelement = outlstnode.toElement();
99 QDomNode fillpnode = synode.namedItem(
"fillpattern" );
100 QDomElement fillpelement = fillpnode.toElement();
106 QDomNode psymbnode = synode.namedItem(
"pointsymbol" );
107 if ( ! psymbnode.isNull() )
109 QDomElement psymbelement = psymbnode.toElement();
110 return psymbelement.text();
112 return QString(
"hard:circle" );
117 QDomNode psizenode = synode.namedItem(
"pointsize" );
118 if ( ! psizenode.isNull() )
120 QDomElement psizeelement = psizenode.toElement();
121 return psizeelement.text().toFloat();
138 if ( symbolName.startsWith(
"hard:" ) )
143 QString name = symbolName.mid( 5 );
149 QString name = symbolName.mid( 4 );
192 QDomNode synode = rnode.namedItem(
"symbol" );
193 if ( synode.isNull() )
204 QDomNode modeNode = rnode.namedItem(
"mode" );
205 QString modeValue = modeNode.toElement().text();
206 QDomNode classnode = rnode.namedItem(
"classificationfield" );
207 QString classificationField = classnode.toElement().text();
210 if ( modeValue ==
"Empty" )
214 else if ( modeValue ==
"Quantile" )
225 QDomNode symbolnode = rnode.namedItem(
"symbol" );
226 while ( !symbolnode.isNull() )
232 double lowerValue = meta.
lowerValue.toDouble();
233 double upperValue = meta.
upperValue.toDouble();
234 QString label = meta.
label;
235 if ( label.isEmpty() )
236 label = QString(
"%1 - %2" ).arg( lowerValue, -1,
'f', 3 ).arg( upperValue, -1,
'f', 3 );
240 symbolnode = symbolnode.nextSibling();
253 QDomNode classnode = rnode.namedItem(
"classificationfield" );
254 QString classificationField = classnode.toElement().text();
258 QDomNode symbolnode = rnode.namedItem(
"symbol" );
259 while ( !symbolnode.isNull() )
266 QString label = meta.
label;
267 if ( label.isEmpty() )
268 label = value.toString();
272 symbolnode = symbolnode.nextSibling();
285 QDomNode singlenode = layerNode.namedItem(
"singlesymbol" );
286 QDomNode graduatednode = layerNode.namedItem(
"graduatedsymbol" );
287 QDomNode continuousnode = layerNode.namedItem(
"continuoussymbol" );
288 QDomNode uniquevaluenode = layerNode.namedItem(
"uniquevalue" );
290 if ( !singlenode.isNull() )
294 else if ( !graduatednode.isNull() )
298 else if ( !continuousnode.isNull() )
302 else if ( !uniquevaluenode.isNull() )
355 if ( penstyle == Qt::NoPen )
359 else if ( penstyle == Qt::SolidLine )
363 else if ( penstyle == Qt::DashLine )
367 else if ( penstyle == Qt::DotLine )
371 else if ( penstyle == Qt::DashDotLine )
373 return "DashDotLine";
375 else if ( penstyle == Qt::DashDotDotLine )
377 return "DashDotDotLine";
379 else if ( penstyle == Qt::MPenStyle )
391 if ( penString ==
"NoPen" )
395 else if ( penString ==
"SolidLine" )
397 return Qt::SolidLine;
399 else if ( penString ==
"DashLine" )
403 else if ( penString ==
"DotLine" )
407 else if ( penString ==
"DashDotLine" )
409 return Qt::DashDotLine;
411 else if ( penString ==
"DashDotDotLine" )
413 return Qt::DashDotDotLine;
415 else if ( penString ==
"MPenStyle" )
417 return Qt::MPenStyle;
427 if ( brushstyle == Qt::NoBrush )
431 else if ( brushstyle == Qt::SolidPattern )
433 return "SolidPattern";
435 else if ( brushstyle == Qt::Dense1Pattern )
437 return "Dense1Pattern";
439 else if ( brushstyle == Qt::Dense2Pattern )
441 return "Dense2Pattern";
443 else if ( brushstyle == Qt::Dense3Pattern )
445 return "Dense3Pattern";
447 else if ( brushstyle == Qt::Dense4Pattern )
449 return "Dense4Pattern";
451 else if ( brushstyle == Qt::Dense5Pattern )
453 return "Dense5Pattern";
455 else if ( brushstyle == Qt::Dense6Pattern )
457 return "Dense6Pattern";
459 else if ( brushstyle == Qt::Dense7Pattern )
461 return "Dense7Pattern";
463 else if ( brushstyle == Qt::HorPattern )
467 else if ( brushstyle == Qt::VerPattern )
471 else if ( brushstyle == Qt::CrossPattern )
473 return "CrossPattern";
475 else if ( brushstyle == Qt::BDiagPattern )
477 return "BDiagPattern";
479 else if ( brushstyle == Qt::FDiagPattern )
481 return "FDiagPattern";
483 else if ( brushstyle == Qt::DiagCrossPattern )
485 return "DiagCrossPattern";
487 else if ( brushstyle == Qt::TexturePattern )
489 return "TexturePattern";
500 if ( brushString ==
"NoBrush" )
504 else if ( brushString ==
"SolidPattern" )
506 return Qt::SolidPattern;
508 else if ( brushString ==
"Dense1Pattern" )
510 return Qt::Dense1Pattern;
512 else if ( brushString ==
"Dense2Pattern" )
514 return Qt::Dense2Pattern;
516 else if ( brushString ==
"Dense3Pattern" )
518 return Qt::Dense3Pattern;
520 else if ( brushString ==
"Dense4Pattern" )
522 return Qt::Dense4Pattern;
524 else if ( brushString ==
"Dense5Pattern" )
526 return Qt::Dense5Pattern;
528 else if ( brushString ==
"Dense6Pattern" )
530 return Qt::Dense6Pattern;
532 else if ( brushString ==
"Dense7Pattern" )
534 return Qt::Dense7Pattern;
536 else if ( brushString ==
"HorPattern" )
538 return Qt::HorPattern;
540 else if ( brushString ==
"VerPattern" )
542 return Qt::VerPattern;
544 else if ( brushString ==
"CrossPattern" )
546 return Qt::CrossPattern;
548 else if ( brushString ==
"BDiagPattern" )
550 return Qt::BDiagPattern;
552 else if ( brushString ==
"FDiagPattern" )
554 return Qt::FDiagPattern;
556 else if ( brushString ==
"DiagCrossPattern" )
558 return Qt::DiagCrossPattern;
560 else if ( brushString ==
"TexturePattern" )
562 return Qt::TexturePattern;
566 QgsDebugMsg( QString(
"Brush style \"%1\" not found" ).arg( brushString ) );