mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
parent
275194dbd5
commit
fccd8e58cd
@ -336,6 +336,7 @@ void QgsAttributeTableModel::loadAttributes()
|
||||
void QgsAttributeTableModel::loadLayer()
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
beginResetModel();
|
||||
|
||||
if ( rowCount() != 0 )
|
||||
{
|
||||
@ -372,6 +373,7 @@ void QgsAttributeTableModel::loadLayer()
|
||||
connect( mLayerCache, SIGNAL( invalidated() ), this, SLOT( loadLayer() ) );
|
||||
|
||||
mFieldCount = mAttributes.size();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void QgsAttributeTableModel::swapRows( QgsFeatureId a, QgsFeatureId b )
|
||||
@ -620,12 +622,7 @@ void QgsAttributeTableModel::reload( const QModelIndex &index1, const QModelInde
|
||||
emit dataChanged( index1, index2 );
|
||||
}
|
||||
|
||||
void QgsAttributeTableModel::resetModel()
|
||||
{
|
||||
beginResetModel();
|
||||
loadLayer();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx ) const
|
||||
{
|
||||
|
@ -117,8 +117,10 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel
|
||||
|
||||
/**
|
||||
* Resets the model
|
||||
*
|
||||
* Alias to loadLayer()
|
||||
*/
|
||||
void resetModel();
|
||||
inline void resetModel() { loadLayer(); }
|
||||
|
||||
/**
|
||||
* Maps feature id to table row
|
||||
|
Loading…
x
Reference in New Issue
Block a user