Skip to content
Permalink
Browse files

Revert "[FEATURE] Show symbol as icon for attribute row"

This reverts commit e3b2a2d.

Revert until I fix the speed issues
  • Loading branch information
NathanW2 committed Jul 11, 2015
1 parent 3390f23 commit bf6f62cd05fe22b939118c07f52c75837567faa8
@@ -27,7 +27,6 @@
#include "qgsmaplayerregistry.h"
#include "qgsrendererv2.h"
#include "qgsvectorlayer.h"
#include "qgssymbollayerv2utils.h"

#include <QVariant>

@@ -38,7 +37,6 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache,
, mLayerCache( layerCache )
, mFieldCount( 0 )
, mCachedField( -1 )
, mIconSize( 16, 16 )
{
QgsDebugMsg( "entered." );

@@ -496,27 +494,6 @@ QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orient
return tr( "feature id" );
}
}
else if ( role == Qt::DecorationRole
&& orientation == Qt::Vertical
&& layer()->geometryType() != QGis::NoGeometry )
{
QgsRenderContext ctx;
QgsFeature feature;
mLayerCache->featureAtId( mRowIdMap[section], feature );

layer()->rendererV2()->startRender( ctx, layer()->pendingFields() );
QgsSymbolV2List symbols = layer()->rendererV2()->symbolsForFeature( feature );
if ( symbols.count() == 0 )
{
layer()->rendererV2()->stopRender( ctx );
return 0;
}

QgsSymbolV2* symbol = symbols.first();
QPixmap pix = QgsSymbolLayerV2Utils::symbolPreviewPixmap( symbol, mIconSize );
layer()->rendererV2()->stopRender( ctx );
return pix;
}
else
{
return QVariant();
@@ -315,8 +315,6 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel
/** Allows caching of one specific column (used for sorting) */
QHash<QgsFeatureId, QVariant> mFieldCache;

QSize mIconSize;

/**
* Holds the bounds of changed cells while an update operation is running
* top = min row

0 comments on commit bf6f62c

Please sign in to comment.
You can’t perform that action at this time.