Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 bf6f62c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
23 changes: 0 additions & 23 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -27,7 +27,6 @@
#include "qgsmaplayerregistry.h"
#include "qgsrendererv2.h"
#include "qgsvectorlayer.h"
#include "qgssymbollayerv2utils.h"

#include <QVariant>

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

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions src/gui/attributetable/qgsattributetablemodel.h
Expand Up @@ -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
Expand Down

0 comments on commit bf6f62c

Please sign in to comment.