Skip to content
Permalink
Browse files

Fewer redraws if toggeling editing from vector props

git-svn-id: http://svn.osgeo.org/qgis/trunk@15173 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Feb 15, 2011
1 parent 3374f38 commit 8e0e6f4af0a6ba09eeb3864cb14acafbaa5061ad
Showing with 3 additions and 9 deletions.
  1. +3 −9 src/app/qgsvectorlayerproperties.cpp
@@ -166,6 +166,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

void QgsVectorLayerProperties::loadRows()
{
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
const QgsFieldMap &fields = layer->pendingFields();

tblAttributes->clear();
@@ -191,6 +192,7 @@ void QgsVectorLayerProperties::loadRows()
setRow( row, it.key(), it.value() );

tblAttributes->resizeColumnsToContents();
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
}

void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
@@ -382,7 +384,7 @@ void QgsVectorLayerProperties::deleteAttribute()

void QgsVectorLayerProperties::editingToggled()
{
if ( layer->isEditable() )
if ( !layer->isEditable() )
loadRows();

updateButtons();
@@ -1200,11 +1202,7 @@ void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
}

layer->addJoin( info );

//prevent complete redraw for each row
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
loadRows(); //update attribute tab
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
addJoinToTreeWidget( info );
}
}
@@ -1241,11 +1239,7 @@ void QgsVectorLayerProperties::on_mButtonRemoveJoin_clicked()
}

layer->removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );

//prevent complete redraw for each row
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
loadRows();
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
}

0 comments on commit 8e0e6f4

Please sign in to comment.
You can’t perform that action at this time.