TUFLOW-Support / QGIS-TUFLOW-Plugin

TUFLOW related QGIS Plugins
9 stars 7 forks source link

QGIS 3.0.3 - Error when adding new raster layer when Tuplot is active #9

Closed Dan-Knott closed 6 years ago

Dan-Knott commented 6 years ago

Hi Guys,

I've been getting this error when i have results loaded into Tuplot, and then add a raster layer to the work space. The error doesn't seem to be critical, and it doesn't seem to affect the operation of either Tuplot or QGIS, it's just a bit of an annoyance.

This is the full text of the error:

An error has occurred while executing Python code: AttributeError: 'QgsRasterLayer' object has no attribute 'selectionChanged' Traceback (most recent call last): File "C:/Users/Daniel.Knott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tuflow\tuflowqgis_TuPlot.py", line 770, in layerChanged self.cLayer.selectionChanged.connect(self.select_changed) AttributeError: 'QgsRasterLayer' object has no attribute 'selectionChanged'

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] QGIS version: 3.0.3-Girona Girona, 8a899c8758 Python Path: • C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python • C:/Users/Daniel.Knott/AppData/Roaming/QGIS/QGIS3\profiles\default/python • C:/Users/Daniel.Knott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins • C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins • C:\Program Files\QGIS 3.0\bin\python36.zip • C:\PROGRA~1\QGIS3~1.0\apps\Python36\DLLs • C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib • C:\Program Files\QGIS 3.0\bin • C:\PROGRA~1\QGIS3~1.0\apps\Python36 • C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages • C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\win32 • C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\win32\lib • C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\Pythonwin • C:/Users/Daniel.Knott/AppData/Roaming/QGIS/QGIS3\profiles\default/python • C:/Users/Daniel.Knott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\joinmultiplelines • C:\Users\Daniel.Knott\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow • C:\Users\Daniel.Knott\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow/forms • C:\Users\Daniel.Knott\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow • C:\Users\Daniel.Knott\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow/forms C:\Users\Daniel.Knott\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow/forms

TUFLOW-Support commented 6 years ago

Hi Dan, thanks for letting us know. I've changed the code in tuflowqgis_TuPlot.py to the following (line 878 - 883):

if self.cLayer is not None: if self.cLayer.isValid(): if self.cLayer.type() == QgsMapLayer.VectorLayer: self.cLayer.selectionChanged.connect(self.select_changed) self.selected_layer = self.cLayer self.refresh()

This will be corrected in the next release.

Thanks, Ellis