PANOimagen / profiletool

Home to the QGis Profiletool plugin. Initial work on this fork was partially funded by the C.A. La Rioja
https://plugins.qgis.org/plugins/profiletool/
GNU General Public License v2.0
33 stars 19 forks source link

AttributeError: 'QObject' object has no attribute 'type' #66

Open jorgealmerio opened 2 years ago

jorgealmerio commented 2 years ago

Hi, friend,

When I close or open another project from Qgis after I has added a Point layer to Profile Tool I got this error! (Traceback below)

If I remove the point layer from the Profile tool the error does NOT happens !

I am using Windows 10 and I have tested it on Qgis 3.18 e 3.20.3.

Anyway, Thanks for this the plugin!

Jorge Almerio

2021-09-24T10:31:01 WARNING Traceback (most recent call last): File "C:\Users/jorgealmerio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\tools\profiletool_core.py", line 109, in self.instance.layersRemoved.connect(lambda: self.removeClosedLayers(self.dockwidget.mdl)) File "C:\Users/jorgealmerio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\tools\profiletool_core.py", line 282, in removeClosedLayers self.dockwidget.removeLayer(i) File "C:\Users/jorgealmerio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\ui\ptdockwidget.py", line 331, in removeLayer self.profiletoolcore.updateProfil(self.profiletoolcore.pointstoDraw, False, True) File "C:\Users/jorgealmerio/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\tools\profiletool_core.py", line 180, in updateProfil if self.dockwidget.mdl.item(i, 5).data(QtCore.Qt.EditRole).type() == qgis.core.QgsMapLayer.VectorLayer: AttributeError: 'QObject' object has no attribute 'type'

nicogodet commented 2 years ago

which version of profiletool ?

jorgealmerio commented 2 years ago

Version 4.2.1

nicogodet commented 2 years ago

I can't reproduce (I was sure I fixed this bug...)

Could you describe step by step to reproduce the issue ?

jorgealmerio commented 2 years ago

1) Open Qgis 2) Open a Qgis project with at least one MDT (Raster) and a Profilable point layer 3) Add the MDT to the profile tool Widget using the "Add Layer" button 4) Add the Profilable point layer to the profile tool Widget using the "Add Layer" button 5) Open another Qgis project

nicogodet commented 2 years ago

That's exactly what I've done and no issue :thinking:

jorgealmerio commented 2 years ago

I will try to record a video later if you want.

Sorry about that

nicogodet commented 2 years ago

If you can, please.

jorgealmerio commented 2 years ago

Sorry for take so long! Please tell me if the attached screenrecord resolution is enough to check it!

https://user-images.githubusercontent.com/16169268/135650080-fdc9aa10-de4e-483c-a40c-7e297d90d9f3.mp4

nicogodet commented 2 years ago

I had this issue recently too.

I don't have time to work on this now and it's not a major issue, you can still use both QGIS and profiletool. I don't know when I could fix this.