Skip to content

Commit

Permalink
Adjust legend box size when updating. Fix problem where vector class.…
Browse files Browse the repository at this point in the history
… items were not deleted in update

git-svn-id: http://svn.osgeo.org/qgis/trunk@9277 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 7, 2008
1 parent fe4b324 commit ca0eb5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -368,6 +368,7 @@ void QgsComposerLegendWidget::on_mUpdatePushButton_clicked()
mLegend->model()->updateItem(currentItem);
}
mLegend->update();
mLegend->adjustBoxSize();
}

void QgsComposerLegendWidget::on_mUpdateAllPushButton_clicked()
Expand Down
3 changes: 2 additions & 1 deletion src/core/composer/qgslegendmodel.cpp
Expand Up @@ -279,7 +279,8 @@ void QgsLegendModel::updateLayer(QStandardItem* layerItem)
if(mapLayer)
{
//delete all the entries under layer item
for(int i = rowCount() - 1; i >= 0; --i)
int currentRowCount = layerItem->rowCount();
for(int i = currentRowCount - 1; i >= 0; --i)
{
layerItem->removeRow(i);
}
Expand Down

0 comments on commit ca0eb5c

Please sign in to comment.