Skip to content

Commit 6f513d1

Browse files
committedSep 20, 2016
Hide proper column in attribute table
Fix #15458
1 parent 359d5e1 commit 6f513d1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
 

‎src/gui/attributetable/qgsattributetablefiltermodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void QgsAttributeTableFilterModel::setAttributeTableConfig( const QgsAttributeTa
188188
{
189189
if ( newColumnMapping.size() == mColumnMapping.size() - removedColumnCount )
190190
{
191-
beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn + removedColumnCount );
191+
beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn );
192192
mColumnMapping = newColumnMapping;
193193
endRemoveColumns();
194194
}

‎src/gui/attributetable/qgsdualview.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ void QgsDualView::tableColumnResized( int column, int width )
481481
if ( sourceCol >= 0 )
482482
{
483483
config.setColumnWidth( sourceCol, width );
484-
mLayerCache->layer()->setAttributeTableConfig( config );
485-
mConfig = config;
484+
setAttributeTableConfig( config );
486485
}
487486
}
488487

@@ -495,7 +494,6 @@ void QgsDualView::hideColumn()
495494
if ( sourceCol >= 0 )
496495
{
497496
config.setColumnHidden( sourceCol, true );
498-
mLayerCache->layer()->setAttributeTableConfig( config );
499497
setAttributeTableConfig( config );
500498
}
501499
}
@@ -518,7 +516,6 @@ void QgsDualView::resizeColumn()
518516
if ( ok )
519517
{
520518
config.setColumnWidth( sourceCol, width );
521-
mLayerCache->layer()->setAttributeTableConfig( config );
522519
setAttributeTableConfig( config );
523520
}
524521
}
@@ -635,7 +632,7 @@ void QgsDualView::onSortColumnChanged()
635632
QgsAttributeTableConfig cfg = mLayerCache->layer()->attributeTableConfig();
636633
cfg.setSortExpression( mFilterModel->sortExpression() );
637634
cfg.setSortOrder( mFilterModel->sortOrder() );
638-
mLayerCache->layer()->setAttributeTableConfig( cfg );
635+
setAttributeTableConfig( cfg );
639636
}
640637

641638
void QgsDualView::sortByPreviewExpression()
@@ -691,7 +688,7 @@ void QgsDualView::setSortExpression( const QString& sortExpression, Qt::SortOrde
691688

692689
mConfig.setSortExpression( sortExpression );
693690
mConfig.setSortOrder( sortOrder );
694-
mLayerCache->layer()->setAttributeTableConfig( mConfig );
691+
setAttributeTableConfig( mConfig );
695692
}
696693

697694
QString QgsDualView::sortExpression() const

0 commit comments

Comments
 (0)