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 359d5e1 commit 6f513d1
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
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,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
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,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 @@ -495,7 +494,6 @@ void QgsDualView::hideColumn()
if ( sourceCol >= 0 )
{
config.setColumnHidden( sourceCol, true );
mLayerCache->layer()->setAttributeTableConfig( config );
setAttributeTableConfig( config );
}
}
Expand All @@ -518,7 +516,6 @@ void QgsDualView::resizeColumn()
if ( ok )
{
config.setColumnWidth( sourceCol, width );
mLayerCache->layer()->setAttributeTableConfig( config );
setAttributeTableConfig( config );
}
}
Expand Down Expand Up @@ -635,7 +632,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 @@ -691,7 +688,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 6f513d1

Please sign in to comment.