QGIS API Documentation
qgsrendererv2.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendererv2.cpp
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgsrendererv2.h"
17 #include "qgssymbolv2.h"
18 #include "qgssymbollayerv2utils.h"
19 #include "qgsrulebasedrendererv2.h"
20 #include "qgsdatadefined.h"
21 
22 #include "qgssinglesymbolrendererv2.h" // for default renderer
23 
24 #include "qgsrendererv2registry.h"
25 
26 #include "qgsrendercontext.h"
27 #include "qgsclipper.h"
28 #include "qgsgeometry.h"
30 #include "qgsfeature.h"
31 #include "qgslogger.h"
32 #include "qgsvectorlayer.h"
33 #include "qgspainteffect.h"
34 #include "qgseffectstack.h"
35 #include "qgspainteffectregistry.h"
36 #include "qgswkbptr.h"
37 #include "qgspointv2.h"
38 
39 #include <QDomElement>
40 #include <QDomDocument>
41 #include <QPolygonF>
42 
43 
44 
46 {
47  return QgsSymbolV2::_getPoint( pt, context, wkbPtr );
48 }
49 
51 {
52  return QgsSymbolV2::_getLineString( pts, context, wkbPtr, clipToExtent );
53 }
54 
56 {
57  return QgsSymbolV2::_getPolygon( pts, holes, context, wkbPtr, clipToExtent );
58 }
59 
61 {
62  if ( symbol )
63  {
64  if ( symbol->type() == QgsSymbolV2::Marker )
65  {
66  QgsMarkerSymbolV2* ms = static_cast<QgsMarkerSymbolV2*>( symbol );
67  if ( ms )
68  {
69  ms->setScaleMethod( static_cast< QgsSymbolV2::ScaleMethod >( scaleMethod ) );
70  }
71  }
72  }
73 }
74 
76 {
77  if ( !destRenderer || !mPaintEffect )
78  return;
79 
80  destRenderer->setPaintEffect( mPaintEffect->clone() );
81  destRenderer->mOrderBy = mOrderBy;
82  destRenderer->mOrderByEnabled = mOrderByEnabled;
83 }
84 
86 {
87  if ( !destRenderer || !mPaintEffect )
88  return;
89 
90  destRenderer->setPaintEffect( mPaintEffect->clone() );
91 }
92 
94  : mType( type )
95  , mUsingSymbolLevels( false )
98  , mPaintEffect( nullptr )
99  , mForceRaster( false )
100  , mOrderByEnabled( false )
101 {
103  mPaintEffect->setEnabled( false );
104 }
105 
107 {
108  delete mPaintEffect;
109 }
110 
112 {
113  return new QgsSingleSymbolRendererV2( QgsSymbolV2::defaultSymbol( geomType ) );
114 }
115 
117 {
118  QgsRenderContext context;
120  return symbolForFeature( feature, context );
121 }
122 
124 {
125  Q_UNUSED( context );
126  // base method calls deprecated symbolForFeature to maintain API
128  return symbolForFeature( feature );
130 }
131 
133 {
135  return symbolForFeature( feature );
137 }
138 
140 {
141  return symbolForFeature( feature, context );
142 }
143 
145 {
146  Q_UNUSED( feature );
147  Q_UNUSED( context );
148  return QSet< QString >();
149 }
150 
152 {
153  startRender( context, vlayer->fields() );
154 }
155 
156 bool QgsFeatureRendererV2::renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer, bool selected, bool drawVertexMarker )
157 {
158  QgsSymbolV2* symbol = symbolForFeature( feature, context );
159  if ( !symbol )
160  return false;
161 
162  renderFeatureWithSymbol( feature, symbol, context, layer, selected, drawVertexMarker );
163  return true;
164 }
165 
166 void QgsFeatureRendererV2::renderFeatureWithSymbol( QgsFeature& feature, QgsSymbolV2* symbol, QgsRenderContext& context, int layer, bool selected, bool drawVertexMarker )
167 {
168  symbol->renderFeature( feature, context, layer, selected, drawVertexMarker, mCurrentVertexMarkerType, mCurrentVertexMarkerSize );
169 }
170 
172 {
173  return "UNKNOWN RENDERER\n";
174 }
175 
177 {
178  QgsRenderContext context;
179  return symbols( context );
180 }
181 
183 {
184  Q_UNUSED( context );
185 
186  //base implementation calls deprecated method to maintain API
188  return symbols();
190 }
191 
192 
194 {
195  // <renderer-v2 type=""> ... </renderer-v2>
196 
197  if ( element.isNull() )
198  return nullptr;
199 
200  // load renderer
201  QString rendererType = element.attribute( "type" );
202 
204  if ( !m )
205  return nullptr;
206 
207  QgsFeatureRendererV2* r = m->createRenderer( element );
208  if ( r )
209  {
210  r->setUsingSymbolLevels( element.attribute( "symbollevels", "0" ).toInt() );
211  r->setForceRasterRender( element.attribute( "forceraster", "0" ).toInt() );
212 
213  //restore layer effect
214  QDomElement effectElem = element.firstChildElement( "effect" );
215  if ( !effectElem.isNull() )
216  {
217  r->setPaintEffect( QgsPaintEffectRegistry::instance()->createEffect( effectElem ) );
218  }
219 
220  // restore order by
221  QDomElement orderByElem = element.firstChildElement( "orderby" );
222  r->mOrderBy.load( orderByElem );
223  r->setOrderByEnabled( element.attribute( "enableorderby", "0" ).toInt() );
224  }
225  return r;
226 }
227 
229 {
230  // create empty renderer element
231  QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
232  rendererElem.setAttribute( "forceraster", ( mForceRaster ? "1" : "0" ) );
233 
235  mPaintEffect->saveProperties( doc, rendererElem );
236 
237  if ( !mOrderBy.isEmpty() )
238  {
239  QDomElement orderBy = doc.createElement( "orderby" );
240  mOrderBy.save( orderBy );
241  rendererElem.appendChild( orderBy );
242  }
243  rendererElem.setAttribute( "enableorderby", ( mOrderByEnabled ? "1" : "0" ) );
244  return rendererElem;
245 }
246 
248 {
249  QDomElement element = node.toElement();
250  if ( element.isNull() )
251  return nullptr;
252 
253  // get the UserStyle element
254  QDomElement userStyleElem = element.firstChildElement( "UserStyle" );
255  if ( userStyleElem.isNull() )
256  {
257  // UserStyle element not found, nothing will be rendered
258  errorMessage = "Info: UserStyle element not found.";
259  return nullptr;
260  }
261 
262  // get the FeatureTypeStyle element
263  QDomElement featTypeStyleElem = userStyleElem.firstChildElement( "FeatureTypeStyle" );
264  if ( featTypeStyleElem.isNull() )
265  {
266  errorMessage = "Info: FeatureTypeStyle element not found.";
267  return nullptr;
268  }
269 
270  // use the RuleRenderer when more rules are present or the rule
271  // has filters or min/max scale denominators set,
272  // otherwise use the SingleSymbol renderer
273  bool needRuleRenderer = false;
274  int ruleCount = 0;
275 
276  QDomElement ruleElem = featTypeStyleElem.firstChildElement( "Rule" );
277  while ( !ruleElem.isNull() )
278  {
279  ruleCount++;
280 
281  // more rules present, use the RuleRenderer
282  if ( ruleCount > 1 )
283  {
284  QgsDebugMsg( "more Rule elements found: need a RuleRenderer" );
285  needRuleRenderer = true;
286  break;
287  }
288 
289  QDomElement ruleChildElem = ruleElem.firstChildElement();
290  while ( !ruleChildElem.isNull() )
291  {
292  // rule has filter or min/max scale denominator, use the RuleRenderer
293  if ( ruleChildElem.localName() == "Filter" ||
294  ruleChildElem.localName() == "MinScaleDenominator" ||
295  ruleChildElem.localName() == "MaxScaleDenominator" )
296  {
297  QgsDebugMsg( "Filter or Min/MaxScaleDenominator element found: need a RuleRenderer" );
298  needRuleRenderer = true;
299  break;
300  }
301 
302  ruleChildElem = ruleChildElem.nextSiblingElement();
303  }
304 
305  if ( needRuleRenderer )
306  {
307  break;
308  }
309 
310  ruleElem = ruleElem.nextSiblingElement( "Rule" );
311  }
312 
313  QString rendererType;
314  if ( needRuleRenderer )
315  {
316  rendererType = "RuleRenderer";
317  }
318  else
319  {
320  rendererType = "singleSymbol";
321  }
322  QgsDebugMsg( QString( "Instantiating a '%1' renderer..." ).arg( rendererType ) );
323 
324  // create the renderer and return it
326  if ( !m )
327  {
328  errorMessage = QString( "Error: Unable to get metadata for '%1' renderer." ).arg( rendererType );
329  return nullptr;
330  }
331 
332  QgsFeatureRendererV2* r = m->createRendererFromSld( featTypeStyleElem, geomType );
333  return r;
334 }
335 
337 {
338  return writeSld( doc, layer.name() );
339 }
340 
342 {
343  QDomElement userStyleElem = doc.createElement( "UserStyle" );
344 
345  QDomElement nameElem = doc.createElement( "se:Name" );
346  nameElem.appendChild( doc.createTextNode( styleName ) );
347  userStyleElem.appendChild( nameElem );
348 
349  QDomElement featureTypeStyleElem = doc.createElement( "se:FeatureTypeStyle" );
350  toSld( doc, featureTypeStyleElem );
351  userStyleElem.appendChild( featureTypeStyleElem );
352 
353  return userStyleElem;
354 }
355 
357 {
358  Q_UNUSED( iconSize );
359  // empty list by default
360  return QgsLegendSymbologyList();
361 }
362 
364 {
365  return false;
366 }
367 
369 {
370  Q_UNUSED( key );
371  return false;
372 }
373 
375 {
376  Q_UNUSED( key );
377  Q_UNUSED( state );
378 }
379 
381 {
382  Q_UNUSED( key );
383  delete symbol;
384 }
385 
387 {
388  Q_UNUSED( scaleDenominator );
389  Q_UNUSED( rule );
390  return QgsLegendSymbolList();
391 }
392 
394 {
395  QgsLegendSymbolList lst = const_cast<QgsFeatureRendererV2*>( this )->legendSymbolItems();
397  int i = 0;
398  for ( QgsLegendSymbolList::const_iterator it = lst.begin(); it != lst.end(); ++it, ++i )
399  {
400  lst2 << QgsLegendSymbolItemV2( it->second, it->first, QString::number( i ), legendSymbolItemsCheckable() );
401  }
402  return lst2;
403 }
404 
406 {
409 }
410 
412 {
414  return nullptr != symbolForFeature( feat );
416 }
417 
419 {
420  return nullptr != symbolForFeature( feat, context );
421 }
422 
424 {
425  QgsVectorLayer::drawVertexMarker( pt.x(), pt.y(), *context.painter(),
428 }
429 
431 {
432  Q_FOREACH ( QPointF pt, pts )
433  renderVertexMarker( pt, context );
434 }
435 
437 {
438  Q_FOREACH ( QPointF pt, pts )
439  renderVertexMarker( pt, context );
440 
441  if ( rings )
442  {
443  Q_FOREACH ( const QPolygonF& ring, *rings )
444  {
445  Q_FOREACH ( QPointF pt, ring )
446  renderVertexMarker( pt, context );
447  }
448  }
449 }
450 
452 {
453  QgsSymbolV2List lst;
455  QgsSymbolV2* s = symbolForFeature( feat );
457  if ( s ) lst.append( s );
458  return lst;
459 }
460 
462 {
463  QgsSymbolV2List lst;
464  QgsSymbolV2* s = symbolForFeature( feat, context );
465  if ( s ) lst.append( s );
466  return lst;
467 }
468 
470 {
471  QgsSymbolV2List lst;
475  if ( s ) lst.append( s );
476  return lst;
477 }
478 
480 {
481  QgsSymbolV2List lst;
482  QgsSymbolV2* s = originalSymbolForFeature( feat, context );
483  if ( s ) lst.append( s );
484  return lst;
485 }
486 
488 {
489  return mPaintEffect;
490 }
491 
493 {
494  delete mPaintEffect;
495  mPaintEffect = effect;
496 }
497 
499 {
500  return mOrderBy;
501 }
502 
504 {
505  mOrderBy = orderBy;
506 }
507 
509 {
510  return mOrderByEnabled;
511 }
512 
514 {
515  mOrderByEnabled = enabled;
516 }
517 
519 {
520  if ( symbol->type() == QgsSymbolV2::Marker )
521  {
522  QgsMarkerSymbolV2 * s = static_cast<QgsMarkerSymbolV2 *>( symbol );
524  {
525  const QgsDataDefined dd( "coalesce(sqrt(" + QString::number( s->size() ) + " * (" + field + ")),0)" );
526  s->setDataDefinedSize( dd );
527  }
528  else
529  {
530  const QgsDataDefined dd( "coalesce(" + QString::number( s->size() ) + " * (" + field + "),0)" );
531  s->setDataDefinedSize( dd );
532  }
534  }
535  else if ( symbol->type() == QgsSymbolV2::Line )
536  {
537  QgsLineSymbolV2 * s = static_cast<QgsLineSymbolV2 *>( symbol );
538  const QgsDataDefined dd( "coalesce(" + QString::number( s->width() ) + " * (" + field + "),0)" );
539  s->setDataDefinedWidth( dd );
540  }
541 }
542 
544 {
545  if ( symbol->type() == QgsSymbolV2::Marker )
546  {
547  QgsMarkerSymbolV2 * s = static_cast<QgsMarkerSymbolV2 *>( symbol );
548  const QgsDataDefined dd(( s->angle()
549  ? QString::number( s->angle() ) + " + "
550  : QString() ) + field );
551  s->setDataDefinedAngle( dd );
552  }
553 }
static QgsRendererV2Registry * instance()
#define RENDERER_TAG_NAME
Definition: qgsrendererv2.h:49
void CORE_EXPORT save(QDomElement &elem) const
Serialize to XML.
virtual QSet< QString > legendKeysForFeature(QgsFeature &feature, QgsRenderContext &context)
Return legend keys matching a specified feature.
void setEnabled(const bool enabled)
Sets whether the effect is enabled.
void setDataDefinedAngle(const QgsDataDefined &dd)
Set data defined angle for whole symbol (including all symbol layers).
A container class for data source field mapping or expression.
GeometryType
Definition: qgis.h:111
QgsFeatureRequest::OrderBy orderBy() const
Get the order in which features shall be processed by this renderer.
QgsFeatureRendererV2(const QString &type)
QString name() const
Get the display name of the layer.
QDomNode appendChild(const QDomNode &newChild)
static QgsFeatureRendererV2 * loadSld(const QDomNode &node, QGis::GeometryType geomType, QString &errorMessage)
Create a new renderer according to the information contained in the UserStyle element of a SLD style ...
SymbolType type() const
Definition: qgssymbolv2.h:104
QString attribute(const QString &name, const QString &defValue) const
virtual QString dump() const
for debugging
void setForceRasterRender(bool forceRaster)
Sets whether the renderer should be rendered to a raster destination.
static QgsConstWkbPtr _getLineString(QPolygonF &pts, QgsRenderContext &context, QgsConstWkbPtr wkb, bool clipToExtent=true)
#define QgsDebugMsg(str)
Definition: qgslogger.h:33
QgsFields fields() const
Returns the list of fields of this layer.
void setDataDefinedSize(const QgsDataDefined &dd)
Set data defined size for whole symbol (including all symbol layers).
virtual Q_DECL_DEPRECATED QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature)
Return symbol for feature.
static QgsExpressionContext createFeatureBasedContext(const QgsFeature &feature, const QgsFields &fields)
Helper function for creating an expression context which contains just a feature and fields collectio...
double size() const
Returns the size for the whole symbol, which is the maximum size of all marker symbol layers in the s...
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer...
Calculate scale by the diameter.
Definition: qgssymbolv2.h:90
VertexMarkerType
Editing vertex markers.
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
#define Q_NOWARN_DEPRECATED_PUSH
Definition: qgis.h:474
Base class for visual effects which can be applied to QPicture drawings.
QDomElement nextSiblingElement(const QString &tagName) const
static void _getPoint(QPointF &pt, QgsRenderContext &context, const QgsPointV2 *point)
Creates a point in screen coordinates from a QgsPointV2 in map coordinates.
Definition: qgssymbolv2.h:261
Container of fields for a vector layer.
Definition: qgsfield.h:187
void CORE_EXPORT load(const QDomElement &elem)
Deserialize from XML.
Stores metadata about one renderer class.
Line symbol.
Definition: qgssymbolv2.h:79
virtual ~QgsFeatureRendererV2()
void renderVertexMarkerPolyline(QPolygonF &pts, QgsRenderContext &context)
render editing vertex marker for a polyline
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
void renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false, int currentVertexMarkerType=0, int currentVertexMarkerSize=0)
Render a feature.
virtual Q_DECL_DEPRECATED bool willRenderFeature(QgsFeature &feat)
Returns whether the renderer will render a feature or not.
virtual bool legendSymbolItemChecked(const QString &key)
items of symbology items in legend is checked
QgsRendererV2AbstractMetadata * rendererMetadata(const QString &rendererName)
get metadata for particular renderer. Returns NULL if not found in registry.
QgsPaintEffect * mPaintEffect
virtual void checkLegendSymbolItem(const QString &key, bool state=true)
item in symbology was checked
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize)
return a list of symbology items for the legend
Marker symbol.
Definition: qgssymbolv2.h:78
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)=0
Needs to be called when a new render cycle is started.
void renderFeatureWithSymbol(QgsFeature &feature, QgsSymbolV2 *symbol, QgsRenderContext &context, int layer, bool selected, bool drawVertexMarker)
QString type() const
Definition: qgsrendererv2.h:83
QDomElement toElement() const
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
virtual Q_DECL_DEPRECATED QgsSymbolV2List originalSymbolsForFeature(QgsFeature &feat)
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbol...
virtual bool renderFeature(QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
Render a feature using this renderer in the given context.
QString number(int n, int base)
virtual Q_DECL_DEPRECATED QgsSymbolV2 * symbolForFeature(QgsFeature &feature)
To be overridden.
qreal x() const
qreal y() const
void append(const T &value)
double width() const
QString localName() const
static QgsPaintEffect * defaultStack()
Returns a new effect stack consisting of a sensible selection of default effects. ...
static QgsPaintEffectRegistry * instance()
Returns a reference to the singleton instance of the paint effect registry.
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule="")
return a list of item text / symbol
int mCurrentVertexMarkerSize
The current size of editing marker.
void setAttribute(const QString &name, const QString &value)
void setOrderByEnabled(bool enabled)
Sets whether custom ordering should be applied before features are processed by this renderer...
int toInt(bool *ok, int base) const
bool isEmpty() const
int mCurrentVertexMarkerType
The current type of editing marker.
double angle() const
Returns the marker angle for the whole symbol.
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the renderer.
virtual QgsFeatureRendererV2 * createRenderer(QDomElement &elem)=0
Return new instance of the renderer given the DOM element.
static QgsFeatureRendererV2 * defaultRenderer(QGis::GeometryType geomType)
return a new renderer - used by default in vector layers
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
static void drawVertexMarker(double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize)
Draws a vertex symbol at (screen) coordinates x, y.
static void convertSymbolSizeScale(QgsSymbolV2 *symbol, QgsSymbolV2::ScaleMethod method, const QString &field)
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
QDomText createTextNode(const QString &value)
iterator end()
void copyRendererData(QgsFeatureRendererV2 *destRenderer) const
Clones generic renderer data to another renderer.
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
bool isNull() const
#define Q_NOWARN_DEPRECATED_POP
Definition: qgis.h:475
void setDataDefinedWidth(const QgsDataDefined &dd)
Set data defined width for whole symbol (including all symbol layers).
void setUsingSymbolLevels(bool usingSymbolLevels)
virtual bool saveProperties(QDomDocument &doc, QDomElement &element) const
Saves the current state of the effect to a DOM element.
Contains information about the context of a rendering operation.
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Define the order in which features shall be processed by this renderer.
QPainter * painter()
static QgsConstWkbPtr _getLineString(QPolygonF &pts, QgsRenderContext &context, QgsConstWkbPtr wkb, bool clipToExtent=true)
Creates a line string in screen coordinates from a wkb string in map coordinates. ...
Q_DECL_DEPRECATED void copyPaintEffect(QgsFeatureRendererV2 *destRenderer) const
Copies paint effect of this renderer to another renderer.
static QgsSymbolV2 * defaultSymbol(QGis::GeometryType geomType)
return new default symbol for specified geometry type
ScaleMethod
Scale method.
Definition: qgssymbolv2.h:87
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbolsForFeature(QgsFeature &feat)
Returns list of symbols used for rendering the feature.
static QgsFeatureRendererV2 * load(QDomElement &symbologyElem)
create a renderer from XML element
static QgsConstWkbPtr _getPolygon(QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, QgsConstWkbPtr wkb, bool clipToExtent=true)
Creates a polygon in screen coordinates from a wkb string in map coordinates.
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const
Return a list of symbology items for the legend.
QgsFeatureRequest::OrderBy mOrderBy
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
void setVertexMarkerAppearance(int type, int size)
set type and size of editing vertex markers for subsequent rendering
QDomElement firstChildElement(const QString &tagName) const
void setScaleMethodToSymbol(QgsSymbolV2 *symbol, int scaleMethod)
virtual Q_DECL_DEPRECATED QDomElement writeSld(QDomDocument &doc, const QgsVectorLayer &layer) const
create the SLD UserStyle element following the SLD v1.1 specs
void renderVertexMarkerPolygon(QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context)
render editing vertex marker for a polygon
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the renderer.
Calculate scale by the area.
Definition: qgssymbolv2.h:89
static QgsConstWkbPtr _getPolygon(QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, QgsConstWkbPtr wkb, bool clipToExtent=true)
static QgsConstWkbPtr _getPoint(QPointF &pt, QgsRenderContext &context, QgsConstWkbPtr wkb)
QDomElement createElement(const QString &tagName)
virtual QgsFeatureRendererV2 * createRendererFromSld(QDomElement &elem, QGis::GeometryType geomType)
Represents a vector layer which manages a vector based data sets.
QList< QPair< QString, QgsSymbolV2 * > > QgsLegendSymbolList
Definition: qgsrendererv2.h:44
The class stores information about one class/rule of a vector layer renderer in a unified way that ca...
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
iterator begin()
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
virtual void setLegendSymbolItem(const QString &key, QgsSymbolV2 *symbol)
Sets the symbol to be used for a legend symbol item.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Represents a list of OrderByClauses, with the most important first and the least important last...
static void convertSymbolRotation(QgsSymbolV2 *symbol, const QString &field)