Skip to content

Commit

Permalink
Hide proper column in attribute table
Browse files Browse the repository at this point in the history
Fix #15458
  • Loading branch information
m-kuhn committed Sep 20, 2016
1 parent e3dbdf2 commit 1856a37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablefiltermodel.cpp
Expand Up @@ -187,7 +187,7 @@ void QgsAttributeTableFilterModel::setAttributeTableConfig( const QgsAttributeTa
{
if ( newColumnMapping.size() == mColumnMapping.size() - removedColumnCount )
{
beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn + removedColumnCount );
beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn );
mColumnMapping = newColumnMapping;
endRemoveColumns();
}
Expand Down
9 changes: 3 additions & 6 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -524,8 +524,7 @@ void QgsDualView::tableColumnResized( int column, int width )
if ( sourceCol >= 0 )
{
config.setColumnWidth( sourceCol, width );
mLayerCache->layer()->setAttributeTableConfig( config );
mConfig = config;
setAttributeTableConfig( config );
}
}

Expand All @@ -538,7 +537,6 @@ void QgsDualView::hideColumn()
if ( sourceCol >= 0 )
{
config.setColumnHidden( sourceCol, true );
mLayerCache->layer()->setAttributeTableConfig( config );
setAttributeTableConfig( config );
}
}
Expand All @@ -561,7 +559,6 @@ void QgsDualView::resizeColumn()
if ( ok )
{
config.setColumnWidth( sourceCol, width );
mLayerCache->layer()->setAttributeTableConfig( config );
setAttributeTableConfig( config );
}
}
Expand Down Expand Up @@ -661,7 +658,7 @@ void QgsDualView::onSortColumnChanged()
QgsAttributeTableConfig cfg = mLayerCache->layer()->attributeTableConfig();
cfg.setSortExpression( mFilterModel->sortExpression() );
cfg.setSortOrder( mFilterModel->sortOrder() );
mLayerCache->layer()->setAttributeTableConfig( cfg );
setAttributeTableConfig( cfg );
}

void QgsDualView::sortByPreviewExpression()
Expand Down Expand Up @@ -717,7 +714,7 @@ void QgsDualView::setSortExpression( const QString& sortExpression, Qt::SortOrde

mConfig.setSortExpression( sortExpression );
mConfig.setSortOrder( sortOrder );
mLayerCache->layer()->setAttributeTableConfig( mConfig );
setAttributeTableConfig( mConfig );
}

QString QgsDualView::sortExpression() const
Expand Down

0 comments on commit 1856a37

Please sign in to comment.