I have QGIS 2.18.18 and 2.18.19 in seperate computers. I use the following script to remove RubberBand items. It works in 2.18.18 but doesn't work in 2.18.19

import qgis

# Get RubberBands
rbs = [ i for i in iface.mapCanvas().scene().items()
            if issubclass(type(i), qgis._gui.QgsRubberBand) ]

# Remove RubberBands
for rb in rbs:
    if rb in iface.mapCanvas().scene().items():

Colored polygons are RubberBand items.

enter image description here

1 Answer 1


I encountered with that problem after I unchecked some built-in plugins. At first I thought it was about version. I don't know why but the script worked after checking again MetaSearch Catalogue Client plugin.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.