Skip to content

Commit

Permalink
Merge pull request #1287 from simonsonc/reset-model
Browse files Browse the repository at this point in the history
Use begin/endResetModel instead of reset
  • Loading branch information
wonder-sk committed Apr 2, 2014
2 parents bc40ab6 + 29c8bc5 commit d3db42d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/core/qgsbrowsermodel.cpp
Expand Up @@ -308,9 +308,10 @@ QModelIndex QgsBrowserModel::findPath( QString path )

void QgsBrowserModel::reload()
{
beginResetModel();
removeRootItems();
addRootItems();
reset(); // Qt4.6 brings better methods beginResetModel + endResetModel
endResetModel();
}

/* Refresh dir path */
Expand Down
3 changes: 2 additions & 1 deletion src/core/symbology-ng/qgscptcityarchive.cpp
Expand Up @@ -1583,9 +1583,10 @@ QModelIndex QgsCptCityBrowserModel::findPath( QString path )

void QgsCptCityBrowserModel::reload()
{
beginResetModel();
removeRootItems();
addRootItems();
reset(); // Qt4.6 brings better methods beginResetModel + endResetModel
endResetModel();
}

/* Refresh dir path */
Expand Down
3 changes: 2 additions & 1 deletion src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -660,7 +660,8 @@ void QgsAttributeTableModel::reload( const QModelIndex &index1, const QModelInde

void QgsAttributeTableModel::resetModel()
{
reset();
beginResetModel();
endResetModel();
}

void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx ) const
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/topology/dockModel.cpp
Expand Up @@ -121,7 +121,8 @@ Qt::ItemFlags DockModel::flags( const QModelIndex &index ) const

void DockModel::resetModel()
{
reset();
beginResetModel();
endResetModel();
}

void DockModel::reload( const QModelIndex &index1, const QModelIndex &index2 )
Expand Down

0 comments on commit d3db42d

Please sign in to comment.