2

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():
        iface.mapCanvas().scene().removeItem(rb)

Colored polygons are RubberBand items.

enter image description here

2

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 checked 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.