doublebyte1 / DiagLeg

Repository for the Diagram Legend QGIS plugin
0 stars 0 forks source link

python error QGIS 2.0.1 ubuntu 13.10 #1

Open baditaflorin opened 10 years ago

baditaflorin commented 10 years ago

An error has occured while executing Python code:

I also tried some solutions from http://stackoverflow.com/questions/1400858/how-to-create-qstring-in-pyqt4 but did not help so much.

Traceback (most recent call last): File "/home/vivi/.qgis2/python/plugins/DiagLeg/diaglegdialog.py", line 224, in onExport self.saveDoc(filename) File "/home/vivi/.qgis2/python/plugins/DiagLeg/diaglegdialog.py", line 73, in saveDoc QMessageBox.critical(self, QString("DiagLeg"), NameError: global name 'QString' is not defined

Python version: 2.7.5+ (default, Sep 19 2013, 13:53:30) [GCC 4.8.1]

QGIS version: 2.0.1-Dufour Dufour, exported

Python path: ['/home/vivi/.qgis2/python/plugins/processing', '/usr/share/qgis/python', '/home/vivi/.qgis2/python', '/home/vivi/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-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/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/share/qgis/python/plugins/fTools/tools']

doublebyte1 commented 10 years ago

Hi, Thanks for your interest in the "Diagram Legend" plugin. In fact there was a bug related to the porting to QGIS 2, since QStrings are no longer supported and I forgot to change some of them. I corrected this in the latest version (2.2), and you should be able to install it if you update the plugin, using the plugin manager:

http://plugins.qgis.org/plugins/DiagLeg/version/2.2/

(By the way, the error you are getting, is because you are trying to save your file in an unsupported format!)

Regarding your suggestion of loading the legend dynamically, that is something that I would definitely like to add, but unfortunately under the current implementation it just cannot be supported. All my code revolves around creating a table using HTML and rendering into graphics (or HTML itself) to export it. It is pretty independent from QGIS. To create a "proper" legend, I would have to hook to QGIS internal legend classes, and possible reimplement them. However, if you want to do it yourself, that would be great! You can grab the full source code, here:

https://github.com/doublebyte1/DiagLeg2.git

That would be a great contribution for the community :-)

                                        cheers,
                                                Joana

On 11 November 2013 20:46, baditaflorin notifications@github.com wrote:

An error has occured while executing Python code:

I also tried some solutions from http://stackoverflow.com/questions/1400858/how-to-create-qstring-in-pyqt4 but did not help so much.

Traceback (most recent call last): File "/home/vivi/.qgis2/python/plugins/DiagLeg/diaglegdialog.py", line 224, in onExport self.saveDoc(filename) File "/home/vivi/.qgis2/python/plugins/DiagLeg/diaglegdialog.py", line 73, in saveDoc QMessageBox.critical(self, QString("DiagLeg"), NameError: global name 'QString' is not defined

Python version: 2.7.5+ (default, Sep 19 2013, 13:53:30) [GCC 4.8.1]

QGIS version: 2.0.1-Dufour Dufour, exported

Python path: ['/home/vivi/.qgis2/python/plugins/processing', '/usr/share/qgis/python', '/home/vivi/.qgis2/python', '/home/vivi/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-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/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/share/qgis/python/plugins/fTools/tools']

— Reply to this email directly or view it on GitHubhttps://github.com/doublebyte1/DiagLeg/issues/1 .

"After a day spent staring at a computer monitor, think of (a) book as a kind of screen saver for your brain”