LegendItem: fix clear() not closing widgets

This commit is contained in:
Max Klein 2020-06-23 17:01:02 +02:00 committed by GitHub
parent 8fce6c6ad8
commit 78d11f8a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,9 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
"""Remove all items from the legend."""
for sample, label in self.items:
self.layout.removeItem(sample)
sample.close()
self.layout.removeItem(label)
label.close()
self.items = []
self.updateSize()