YoannQDQ / qgis-memory-layer-saver

Makes data in memory provider layers persistent between QGIS sessions. Data saved in .mldata file alongside project file.
Other
7 stars 4 forks source link

exceptions trying to use the plugin #4

Closed rduivenvoorde closed 9 years ago

rduivenvoorde commented 9 years ago

Hi, Thanks for the plugin. I think I had it working earliers, but now I have the following exception when I load the plugin:

Traceback (most recent call last): File "/tmp/foo/python/plugins/MemoryLayerSaver/MemoryLayerSaver.py", line 237, in connectProvider QObject.connect(layer, SIGNAL("committedFeaturesRemoved(const QString &, const QgsFeatureIds & )"),self.setProjectDirty2) TypeError: C++ type 'QgsFeatureIds' is not supported as a slot argument type

Both in Master and 2.8.2, I'm on self build QGIS on Debian Testing

To reproduce:

I tried to use a clean environment by creating a fresh config: qgis --configpath /tmp/foo2 (first time it fails, but second time it is ok) then install the memory layer plugin saver create a new 'scratch layer' try to save the project.

Full output below of both 2.8.2 and master:

Traceback (most recent call last): File "/tmp/foo/python/plugins/MemoryLayerSaver/MemoryLayerSaver.py", line 237, in connectProvider QObject.connect(layer, SIGNAL("committedFeaturesRemoved(const QString &, const QgsFeatureIds & )"),self.setProjectDirty2) TypeError: C++ type 'QgsFeatureIds' is not supported as a slot argument type

Python version: 2.7.10 (default, Jun 1 2015, 16:21:46) [GCC 4.9.2]

QGIS version: 2.8.2-Wien Wien, 00a0399

Python path: ['/home/richard/apps/qgis/2.8/debug/share/qgis/python/plugins/processing', '/home/richard/apps/qgis/2.8/debug/share/qgis/python', u'/tmp/foo/python', u'/tmp/foo/python/plugins', '/home/richard/apps/qgis/2.8/debug/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2', u'/tmp/foo/python', '/home/richard/apps/qgis/2.8/debug/share/qgis/python/plugins/fTools/tools']

An error has occured while executing Python code:

Traceback (most recent call last): File "/tmp/foo2/python/plugins/MemoryLayerSaver/MemoryLayerSaver.py", line 237, in connectProvider QObject.connect(layer, SIGNAL("committedFeaturesRemoved(const QString &, const QgsFeatureIds & )"),self.setProjectDirty2) TypeError: C++ type 'QgsFeatureIds' is not supported as a slot argument type

Python version: 2.7.10 (default, Jun 1 2015, 16:21:46) [GCC 4.9.2]

QGIS version: 2.9.0-Master Master, 012f322

Python path: ['/home/richard/apps/qgis/master/debug/share/qgis/python/plugins/processing', '/home/richard/apps/qgis/master/debug/share/qgis/python', u'/tmp/foo2/python', u'/tmp/foo2/python/plugins', '/home/richard/apps/qgis/master/debug/share/qgis/python/plugins', '/usr/lib/grass64/etc/python', '/home/richard', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2', '/home/richard/apps/qgis/master/debug/share/qgis/python/plugins/fTools/tools', '/tmp']

ccrook commented 9 years ago

Hi Richard

Thanks for letting me know about this.

Unfortunately I cannot replicate this (on Ubuntu 14.04, same versions of Qt). I suspect this will be due to a difference in either the PyQt version (I am using 4.10.4), or more likely I think the SIP version (I am using 4.15.5). These can be found in the python console with

from PyQt4.pyqtconfig import Configuration cfg=Configuration() print cfg.pyqt_version_str print cfg.pyqt_version_str

I suspect the problem will be because QgsFeatureIds is defined by a typedef rather than as a class definition?

I've attached a possible revised version of the main plugin python file (not sure if this will get through github). If you are able to install this into ~/.qgis2/python/plugins/MemoryLayerSaver it may fix the problem? Let me know!

https://github.com/ccrook/QGIS-MemoryLayerSaver-Plugin/blob/issue_4_fix/MemoryLayerSaver/MemoryLayerSaver.py Cheers Chris

rduivenvoorde commented 9 years ago

thanks Chris for the fix!

it fixes this problem both in master and 2.8.2 with me!

for reference, I'm on Debian testing:

print cfg.pyqt_version_str 4.11.3

ccrook commented 9 years ago

Fixed in version 3.6 of the plugin