Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jorgealmerio opened this issue Sep 24, 2021 · 9 comments
Open

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

jorgealmerio opened this issue Sep 24, 2021 · 9 comments
Labels

Comments

@jorgealmerio
Copy link

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
Copy link
Collaborator

which version of profiletool ?

@jorgealmerio
Copy link
Author

Version 4.2.1

@nicogodet
Copy link
Collaborator

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

Could you describe step by step to reproduce the issue ?

@jorgealmerio
Copy link
Author

  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
Copy link
Collaborator

That's exactly what I've done and no issue 🤔

@jorgealmerio
Copy link
Author

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

Sorry about that

@nicogodet
Copy link
Collaborator

If you can, please.

@jorgealmerio
Copy link
Author

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

ProfileTool_issue.mp4

@nicogodet
Copy link
Collaborator

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.

@nicogodet nicogodet added the bug label Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants