[QGIS Commit] r12587 - trunk/qgis/src/app/legend
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Dec 22 17:06:39 EST 2009
Author: jef
Date: 2009-12-22 17:06:38 -0500 (Tue, 22 Dec 2009)
New Revision: 12587
Modified:
trunk/qgis/src/app/legend/qgslegendlayer.cpp
Log:
show classification attribute above the classes in legend
Modified: trunk/qgis/src/app/legend/qgslegendlayer.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayer.cpp 2009-12-22 21:45:15 UTC (rev 12586)
+++ trunk/qgis/src/app/legend/qgslegendlayer.cpp 2009-12-22 22:06:38 UTC (rev 12587)
@@ -216,6 +216,26 @@
const QgsRenderer* renderer = layer->renderer();
const QList<QgsSymbol*> sym = renderer->symbols();
+ //create an item for each classification field (only one for most renderers)
+ QSettings settings;
+ if ( settings.value( "/qgis/showLegendClassifiers", false ).toBool() )
+ {
+ if ( renderer->needsAttributes() )
+ {
+ QgsAttributeList classfieldlist = renderer->classificationAttributes();
+ const QgsFieldMap& fields = layer->pendingFields();
+ for ( QgsAttributeList::iterator it = classfieldlist.begin(); it != classfieldlist.end(); ++it )
+ {
+ QString classfieldname = layer->attributeAlias( *it );
+ if ( classfieldname.isEmpty() )
+ {
+ classfieldname = fields[*it].name();
+ }
+ itemList.append( qMakePair( classfieldname, QPixmap() ) );
+ }
+ }
+ }
+
for ( QList<QgsSymbol*>::const_iterator it = sym.begin(); it != sym.end(); ++it )
{
QImage img;
@@ -255,27 +275,6 @@
itemList.append( qMakePair( values, pix ) );
}
-
- //create an item for each classification field (only one for most renderers)
- QSettings settings;
- if ( settings.value( "/qgis/showLegendClassifiers", false ).toBool() )
- {
- if ( renderer->needsAttributes() )
- {
- QgsAttributeList classfieldlist = renderer->classificationAttributes();
- const QgsFieldMap& fields = layer->pendingFields();
- for ( QgsAttributeList::iterator it = classfieldlist.begin(); it != classfieldlist.end(); ++it )
- {
- QString classfieldname = layer->attributeAlias( *it );
- if ( classfieldname.isEmpty() )
- {
- classfieldname = fields[*it].name();
- }
- itemList.append( qMakePair( classfieldname, QPixmap() ) );
- }
- }
- }
-
changeSymbologySettings( layer, itemList );
}
More information about the QGIS-commit
mailing list