Adjust legend box size when updating. Fix problem where vector class. items were not deleted in update

git-svn-id: http://svn.osgeo.org/qgis/trunk@9277 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2008-09-07 11:12:35 +00:00
parent fe4b324ca0
commit ca0eb5c543
2 changed files with 3 additions and 1 deletions

View File

@ -368,6 +368,7 @@ void QgsComposerLegendWidget::on_mUpdatePushButton_clicked()
mLegend->model()->updateItem(currentItem);
}
mLegend->update();
mLegend->adjustBoxSize();
}
void QgsComposerLegendWidget::on_mUpdateAllPushButton_clicked()

View File

@ -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);
}