mpetroff / qgsazimuth

Fork of http://sourceforge.net/projects/qgsazimuth/
7 stars 3 forks source link

Python Errors when launching #31

Closed marathon715 closed 7 months ago

marathon715 commented 1 year ago

I keep getting a Python error on launching the Azimuth and Distance Plugin. The issue is intermittent when launching for the first time in a session, but always occurs when closing the plugin and trying to relaunch it in the same session. Uninstalling and reinstalling it usually fixes the issue, but that's kind of a pain. I'm not very experienced in Python, but Here is the error:

2023-09-19T08:54:41 WARNING Traceback (most recent call last): File "C:\Users/zasbh1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgsAzimuth\qgsAzimuth.py", line 190, in run self.loadConf() # get config data File "C:\Users/zasbh1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgsAzimuth\qgsAzimuth.py", line 1022, in loadConf self.pluginGui.move(position) TypeError: arguments did not match any overloaded call: move(self, QPoint): argument 1 has unexpected type 'QVariant' move(self, int, int): argument 1 has unexpected type 'QVariant'

Here are all of my pertinent (I think) versions:

QGIS version 3.28.8-Firenze

Python version 3.9.5

OS version Windows 10 Version 2009

I have also run the plugin on the QGIS Białowieża and Hertogenbosch releases, as well as Windows 11, and have had the same error. Any ideas? Thanks in advance for your help - your plugin is very useful for parcel mapping!

mpetroff commented 1 year ago

I can't reproduce the issue, but it looks very similar to #22. I suspect it has something to do with where you dock / locate the plugin's GUI window.

I just committed a potential fix in 1d303424f3b0797c3ac6ef059910fee5109c6110.

Could you please download the new version of qgsAzimuth.py and replace your C:\Users\zasbh1\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgsAzimuth\qgsAzimuth.py file with the new version to see if the fix works?

marathon715 commented 1 year ago

Interesting- I always drag the plugin window to a different monitor. I wonder if that has something to with it. I’ll test it and get back to you. Maybe the workaround is something as simple as re-docking the window before closing it.Thanks so much for following up - I use the plugin to verify the measurements on survey maps, and it’s absolutely invaluable for that purpose!

marathon715 commented 12 months ago

That was it - as long as the plugin window stays on the same monitor as the rest of the application, the error does not occur. If the plugin window is is moved to a different monitor, and closed while displayed on that monitor, then a Python error is thrown on the next attempted launch.

mpetroff commented 12 months ago

Did you update the Python file and see if my attempted fix worked?

marathon715 commented 11 months ago

Sorry it took so long to get back to you, but it works now - I can close the window on any monitor and it re-launches no problem. Thanks so much for working on the fix!!

stantonium commented 9 months ago

This still happened to me when I re-installed the plugin. After initial reinstall it works on relaunch, but not the first time after an new install.

mpetroff commented 8 months ago

@stantonium I hadn't pushed a new release to the QGIS plugins repository, so unless you were manually installing the plugin from this Git repository, you wouldn't have had the fix. I just tagged and uploaded a new release (v0.9.17), so it should be available soon, once the update is approved by the QGIS repository moderators.