Artelia / PostTelemac

Plugin for QGIS to manage Telemac results
19 stars 8 forks source link

Export Flow Graph #15

Open ghost opened 6 years ago

ghost commented 6 years ago

Copy-pasting the temporal graph works (e.g. to have the timeseries in Excel.). Same thing for the "Flow" tool does not work. Problem is reproducible with different QGIS Versions. Any easy fix for that? (Plugin version 1.0.1? At least according to the QGIS Plugin Repository)

An error has occurred while executing Python code: 

NameError: global name 'QApplication' is not defined 
Traceback (most recent call last):
  File "C:/Users/%USER%/.qgis2/python/plugins\PostTelemac\meshlayertools\meshlayer_flow_tool.py", line 353, in copygraphclipboard
    self.clipboard = QApplication.clipboard()
NameError: global name 'QApplication' is not defined

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] 
QGIS version: 2.18.14 Las Palmas, ff83b9a479
ghost commented 6 years ago

Found a quick fix: It works if I insert the following line before line 353 in meshlayer_flow_tool.py

from qgis.PyQt.QtGui import QApplication

Just copy-pasted it from the working temporal graph python file, as I have a "rather limited" understanding of Python. So maybe somebody can add this (at the proper position possibly) to the main code?