Closed FlyingEagle closed 1 year ago
@FlyingEagle Thanks for reporting. We'll investigate this asap.
In Line 51 of file utils\maptools.py, change
self.rubberBand = QgsRubberBand(self.canvas, False)
into this, and it'll work.
self.rubberBand = QgsRubberBand(self.canvas)
@FlyingEagle Looks good. A PR would be welcome. But make sure to add it as a try:catch to be downwards compatible. :)
@FlyingEagle do you have any idea on what changed such that False
isn't allowed anymore?
I couldn't find any version of QgsRubberBand
that'd take bool
as a second argument, so I assume that there was an implicit type conversion from bool
to QgsWkbTypes.GeometryType
via the int
underlying the latter?
Other than that, I think we should go with QgsRubberBand(self.canvas, QgsWkbType.LineGeometry), since
QgsWkbType.LineGeometry` seems to be the default for the second argument, and I'd go for explicit over implicit here.
An error has occurred while executing Python code:
TypeError: QgsRubberBand(): argument 2 has unexpected type 'bool' Traceback (most recent call last): File "C:\Users/lw/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\gui\ORStoolsDialog.py", line 464, in _on_linetool_init self.line_tool = maptools.LineTool(self._iface.mapCanvas()) File "C:\Users/lw/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\utils\maptools.py", line 51, in init self.rubberBand = QgsRubberBand(self.canvas, False) TypeError: QgsRubberBand(): argument 2 has unexpected type 'bool'
Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.30.0-'s-Hertogenbosch 's-Hertogenbosch, f186b8efe0e
Open Dialog -> Klick Green Plus ...