Skip to content

Commit 1856a37

Browse files
committedSep 20, 2016
Hide proper column in attribute table
Fix #15458
1 parent e3dbdf2 commit 1856a37

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
@@ -187,7 +187,7 @@ void QgsAttributeTableFilterModel::setAttributeTableConfig( const QgsAttributeTa
187187
{
188188
if ( newColumnMapping.size() == mColumnMapping.size() - removedColumnCount )
189189
{
190-
beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn + removedColumnCount );
190+
beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn );
191191
mColumnMapping = newColumnMapping;
192192
endRemoveColumns();
193193
}

‎src/gui/attributetable/qgsdualview.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,7 @@ void QgsDualView::tableColumnResized( int column, int width )
524524
if ( sourceCol >= 0 )
525525
{
526526
config.setColumnWidth( sourceCol, width );
527-
mLayerCache->layer()->setAttributeTableConfig( config );
528-
mConfig = config;
527+
setAttributeTableConfig( config );
529528
}
530529
}
531530

@@ -538,7 +537,6 @@ void QgsDualView::hideColumn()
538537
if ( sourceCol >= 0 )
539538
{
540539
config.setColumnHidden( sourceCol, true );
541-
mLayerCache->layer()->setAttributeTableConfig( config );
542540
setAttributeTableConfig( config );
543541
}
544542
}
@@ -561,7 +559,6 @@ void QgsDualView::resizeColumn()
561559
if ( ok )
562560
{
563561
config.setColumnWidth( sourceCol, width );
564-
mLayerCache->layer()->setAttributeTableConfig( config );
565562
setAttributeTableConfig( config );
566563
}
567564
}
@@ -661,7 +658,7 @@ void QgsDualView::onSortColumnChanged()
661658
QgsAttributeTableConfig cfg = mLayerCache->layer()->attributeTableConfig();
662659
cfg.setSortExpression( mFilterModel->sortExpression() );
663660
cfg.setSortOrder( mFilterModel->sortOrder() );
664-
mLayerCache->layer()->setAttributeTableConfig( cfg );
661+
setAttributeTableConfig( cfg );
665662
}
666663

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

718715
mConfig.setSortExpression( sortExpression );
719716
mConfig.setSortOrder( sortOrder );
720-
mLayerCache->layer()->setAttributeTableConfig( mConfig );
717+
setAttributeTableConfig( mConfig );
721718
}
722719

723720
QString QgsDualView::sortExpression() const

0 commit comments

Comments
 (0)
Please sign in to comment.