2

I have several plugins I am using that involve rubberbands and their equivalent points (QgisVertexMarkers). My problem looks to come from removing them from the display. This process worked fine in QGIS 3.8, But now QGIS crashes with version 3.10.

The code I'm using is shown here.

    vertex_items = [ i for i in self.iface.mapCanvas().scene().items() if issubclass(type(i), QgsVertexMarker)]
    for ver in vertex_items:
        if ver.data(1)=="COGOStartPoint":
            self.iface.mapCanvas().scene().removeItem(ver)

    m = QgsVertexMarker(self.iface.mapCanvas())
    red = QColor(255, 0, 0,255)
    m.setIconType(4)  #1=cross,  2=x,  3=box,  4=circle
    m.setIconSize(8)
    m.setPenWidth(2)
    m.setCenter(QgsPointXY(pt))
    m.setColor(red)
    m.setData(1,"COGOStartPoint")
    m.show()

It seems to be the first few lines of code that causes the freeze. Trying to remove the points no longer works, drawing the points is still fine. I found this technique from PyGIS remove QgisVertexMarker from scene .

What has changed in version 3.10 from 3.8 that would cause this behavior?

Is this still the best way (the only way) to remove rubberband type graphics?

1

Apparently, this was a bug, but has been corrected and will be in the next release. 3.10.1 (available November 25) should have it fixed. Thanks for all the work!

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.