Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix signal loop when resizing columns on opening attribute table
(cherry-picked from 4d40202)
  • Loading branch information
nyalldawson committed Apr 2, 2018
1 parent 5f1d3db commit a9606ea
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -667,7 +667,7 @@ void QgsDualView::tableColumnResized( int column, int width )
{
QgsAttributeTableConfig config = mConfig;
int sourceCol = config.mapVisibleColumnToIndex( column );
if ( sourceCol >= 0 )
if ( sourceCol >= 0 && config.columnWidth( sourceCol ) != width )
{
config.setColumnWidth( sourceCol, width );
setAttributeTableConfig( config );
Expand Down Expand Up @@ -840,9 +840,13 @@ void QgsDualView::previewExpressionChanged( const QString &expression )
void QgsDualView::onSortColumnChanged()
{
QgsAttributeTableConfig cfg = mLayer->attributeTableConfig();
cfg.setSortExpression( mFilterModel->sortExpression() );
cfg.setSortOrder( mFilterModel->sortOrder() );
setAttributeTableConfig( cfg );
if ( cfg.sortExpression() != mFilterModel->sortExpression() ||
cfg.sortOrder() != mFilterModel->sortOrder() )
{
cfg.setSortExpression( mFilterModel->sortExpression() );
cfg.setSortOrder( mFilterModel->sortOrder() );
setAttributeTableConfig( cfg );
}
}

void QgsDualView::sortByPreviewExpression()
Expand Down

0 comments on commit a9606ea

Please sign in to comment.